I am working on a project and when a person touches the trigger the script is supposed to transfer the "squeaks" - leaderstat value to the "coins" -leaderstat value. I have listed my script below:
script.Parent.Touched:Connect(function(hit)
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
if plr then
plr.leaderstats.Coins = plr.leaderstats.Coins.Value + plr.leaderstats.Sqeaks.Value
plr.leaderstats.Sqeaks.Value = 0
end
end)

2 comments
Does it show any errors in the output log?
Hey, did you put this script in a normal script and not a local script?