What is the buildism equivalent of game.Players:getPlayerFromCharacter()
#1
I can't find it on the wiki, and it doesn't seem to be the same as on roblox
Reply
#2
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]
Reply
#3
Derp

I probably should have figured out I could do it that way.

I think I'm too used to roblox spoonfeeding me D:
Reply
#4
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).
Reply
#5
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]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)