Trying make it so where you touch this brick name Gold, you get 500 cash added onto your leaderboard cash.
print("Servano's Cash Running")
function onPlayerEntered(newPlayer) wait(.5) local stats = Instance.new("IntValue") stats.Name = "leaderstats"
local Cash = Instance.new("IntValue")
Cash.Name = "Cash" Cash.Value = 0
Cash.Parent = stats
--test
GoldTouch = game.Workspace.Gold GoldTouch.Touched:connect(function(hit)
newPlayer.leaderstats.Cash.Value = newPlayer.leaderstats.Cash.Value + 500
end) --test while newPlayer.Character == nil do wait() end
local Player = string.lower(newPlayer.Name)
if Player == "Verocitiy" then Cash.Value = 100000 end
stats.Parent = newPlayer
end
game.Players.ChildAdded:connect(onPlayerEntered)

3 comments
What's "Player?" It doesn't exist anywhere else in your case, except on line 2, but even so, your calling it as a value when it's a nil value.
look now
Codeblock everything plz