This is a decently simple script that completely works in studio. When I actually test it in game, it does't work. Does anyone know why?
script.Parent.Touched:connect(function(part)
local leaderstats = game.Players.LocalPlayer:WaitForChild("leaderstats")
local plr = game.Players:GetPlayerFromCharacter(part.Parent)
if leaderstats["Raw Robloxs"].Value ~= 0 then
wait(0.1)
leaderstats.Money.Value = leaderstats.Money.Value + leaderstats["Raw Robloxs"].Value
wait(0.1)
leaderstats["Raw Robloxs"].Value = 0
end
end)

2 comments
Thanks!
Np :)