Jump to content

Recommended Posts

Posted

Is it possible to attach a script to an entity created with code?

My searching suggests that there was a function called Entity:SetScript() but I can't find it when searching the documentation (and I am not at the computer with LeadWerks to test it right now).

 

EDIT:

Ok it looks like Entity:SetScript() does exist but isn't documented. Some documentation would be nice, I still need to experiment to see whether Script:Start() is called automatically or not after attaching it.

Posted

Script:Start is called when using Entity:SetScript :)

 

I had troubles finding this at first too. There are quite some functions which aren't documented. Quite a pity

  • Upvote 1

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.

×
×
  • Create New...