Aki Posted April 27, 2016 Share Posted April 27, 2016 There are two lua commands: say and echo. I'm trying to make small script for... reasons. But I'm having hard time to get player object based on name, I have tried various function names on Server() or sender or Player()but none of them was successful. I know that I just need playerIndex from somewhere (based on sender). Thanks in advance. Link to comment Share on other sites More sharing options...
Boxelware Team koonschi Posted April 27, 2016 Boxelware Team Share Posted April 27, 2016 It depends on the context of the script. Client scripts can just call Player(), while server scripts generally have to use Galaxy():findFaction(name). If you're editing a player script on the server, call getParentFaction(), it will return the player. Link to comment Share on other sites More sharing options...
Aki Posted April 27, 2016 Author Share Posted April 27, 2016 Thank you! So it was Galaxy()... Now when I think of it. It makes sense, because playerIndex is faction (some bug report told me about it) and after all our names are faction names. Now I'm angry on myself for not figuring that out. Thanks again! Link to comment Share on other sites More sharing options...
Best4Gamers Posted April 28, 2016 Share Posted April 28, 2016 just figured out how to spawn player ships with full weapons and modules ... then hell broke loose LOL spawned 100 ships my script broke again hahaha Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now