Posts: 1,586
Threads: 85
Joined: Apr 2011
Reputation:
0
I can't find it on the wiki, and it doesn't seem to be the same as on roblox
Posts: 5,683
Threads: 413
Joined: Aug 2012
Reputation:
0
08-07-2011, 03:00 PM
(This post was last modified: 08-07-2011, 03:00 PM by Whyrrak.)
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]
Posts: 1,586
Threads: 85
Joined: Apr 2011
Reputation:
0
Derp
I probably should have figured out I could do it that way.
I think I'm too used to roblox spoonfeeding me D:
Posts: 5,683
Threads: 413
Joined: Aug 2012
Reputation:
0
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).
Posts: 2,843
Threads: 382
Joined: Jul 2012
Reputation:
0
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]