Jump to content

Lua Scripts Functions


Yue
 Share

Recommended Posts

function UpdatePlayer()


end

This is a global function and once defined you can call it from any script in your app. The other one's scope is on that entity only. So you'd first need a reference to that entities script (like entity1.script:UpdatePlayer()) to be able to call it. Note that inside UpdatePlayer() you can't use the normal self.entity because inside that script it doesn't know anything about that. So global functions work on global data or data you pass into it from a parameter (in this case you have no parameter).

  • Upvote 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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.

 Share

×
×
  • Create New...