Jump to content

Recommended Posts

Posted

Hi everyone!

In my Script i need to GetPosition() of the local entity, which script can not use.

How to do it?

 

I have fpsplayer on the map. And i need to use it from the local script

Posted

I don't fully understand your question. Do you mean from 1 script how to get the position of another entity? You can link them with script variables like:

 

Script.player = nil --entity

 

Then in the editor draw the player to this field in the script tab of your other entity and now inside that you can use self.player to refer to the player entity. You can do this with any and all entities.

  • Upvote 1
Posted

I don't fully understand your question. Do you mean from 1 script how to get the position of another entity? You can link them with script variables like:

 

Script.player = nil --entity

 

Then in the editor draw the player to this field in the script tab of your other entity and now inside that you can use self.player to refer to the player entity. You can do this with any and all entities.

 

Thank you very much, Rick! :)

 

Best regards

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...