# ☑ Access array from another script

**URL:** <https://forum.playcanvas.com/t/access-array-from-another-script/2455>\
**Category:** Help & Support\
**Created:** [September 14, 2016, 1:11pm UTC](https://forum.playcanvas.com/t/access-array-from-another-script/2455 "2016-09-14T13:11:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ayrin](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/ayrin/32/849_2.png) [@ayrin](https://forum.playcanvas.com/u/ayrin)\
**Post date:** [September 14, 2016, 1:11pm UTC](https://forum.playcanvas.com/t/access-array-from-another-script/2455/1 "2016-09-14T13:11:28Z")

</div>

Hello, i want to access to an array from another script: i have a dbase script with arrays of objects, and i have this code into player script  
var targDB=‘potions’;  
var inve= app.root.script.dbase[targDB];  
but don’t work…i’m sure i’m at fault…but where?

---

<div class="post-metadata">

**Author:** ![max](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/max/32/477_2.png) [@max](https://forum.playcanvas.com/u/max)\
**Post date:** [September 14, 2016, 1:28pm UTC](https://forum.playcanvas.com/t/access-array-from-another-script/2455/2 "2016-09-14T13:28:43Z")

</div>

`app.root` - is not a root entity.  
`app.root.children[0]` - is root entity of your scene.

---

<div class="post-metadata">

**Author:** ![ayrin](https://forum.playcanvas.com/user_avatar/forum.playcanvas.com/ayrin/32/849_2.png) [@ayrin](https://forum.playcanvas.com/u/ayrin)\
**Post date:** [September 14, 2016, 3:01pm UTC](https://forum.playcanvas.com/t/access-array-from-another-script/2455/3 "2016-09-14T15:01:29Z")

</div>

😃 i see 😛 i’m sorry how silly of me (digging a hole to hide)
