Jump to content
2ima

Using of the variable in other script

Recommended Posts

The thing is: how can I use a variable in one script stated on other script in lua?

On example: I have 2 scripts: fps_gun.lua with a variable of ammo_count and a script App.lua with a variable named ammo_ammount. How can I use a ammo_count in App.lua(4example ammo_ammount=ammo_count)

Thanks beforehand! unsure.png

Share this post


Link to post

To variables in App.lua script you can refer in any other script like this:


App.ammo_amount=self.ammo_count

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...