Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would I locate the player / make a variable for it?[CLOSED]

Asked by
nanaluk01 247 Moderation Voter
9 years ago

I've gotten help on this script before, and now I need to know how I would find the new player who joined so that I wont get an error on :

local cash = game.ServerStorage.PlayerMoney:FindFirstChild(player.Name)

Here is my script:

local cash = game.ServerStorage.PlayerMoney:FindFirstChild(player.Name) --Getting cash value. 

cash.Changed:connect(function()

    --Called when the cash value changes.

    --(when money is added or subtracted)

    game.Workspace.Display.GUI.Amount.Text = "$ "..cash.Value

    --Set the display value.

end)

Answer this question