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

Why wont this work it grabs the player name but doesn't work?

Asked by 5 years ago
Edited 5 years ago

script.parent.Touched:connect(function(hit)

local Name = hit.parent.Name

game.players.Name.leaderstats.Cash.value = game.players.Name.leaderstats.Cash.value + 10 end)

1 answer

Log in to vote
0
Answered by 5 years ago
script.Parent.Touched:connect(function(hit)
local plrname = hit.Parent.Name
game.Players[plrname].leaderstats.Cash.Value = game.Players[plrname].leaderstats.Cash.Value +10 
end)
0
Thank you ChronoStrike -7 — 5y
Ad

Answer this question