08-07-2011, 02:58 PM
I can't find it on the wiki, and it doesn't seem to be the same as on roblox
What is the buildism equivalent of game.Players:getPlayerFromCharacter()
|
08-07-2011, 02:58 PM
I can't find it on the wiki, and it doesn't seem to be the same as on roblox
You have to do it the hard way.
[lua] --SCHTUPH local character = script.Parent --(or hit.Parent or whatever) local player = game.Players:getChild(character.Name) if player then --MOARE SCHTUPH end --EEVIN MOARE SCHTUPH [/lua]
08-07-2011, 03:02 PM
Derp
I probably should have figured out I could do it that way. I think I'm too used to roblox spoonfeeding me D:
08-07-2011, 03:05 PM
If you can code it the regular way, using simpler terms, you can often get more done than if you have to rely on the 'longcuts' that often pop up.
I've found that quite often, all I need to use in a script right now are properties, variables, for loops, while loops, os.time(), sleep(), getChildren(), getChild(), and link(event, function).
08-07-2011, 05:27 PM
If you're sure the player is there, you can do it the quick way: (this will break the script if it can't find the player)
[lua] player = game.Players[character.Name] [/lua] |
« Next Oldest | Next Newest »
|