local playersService = game:GetService("Players")
script.Parent.Touched:Connect(function(partTouched)
if partTouched.Parent:FindFirstChild("Humanoid") then
local player = playersService:GetPlayerFromCharacter(partTouched.Parent)
if player then
player.leaderstats.Coins.Value = player.leaderstats.Coins.Value + 1
script.Parent:Destroy()
end
end
end)
this one is inside the coin text as a local script
local player = game.Players.LocalPlayer
player.leaderstats.Coins:GetPropertyChangedSignal("Value"):Connect(function()
script.Parent.Text = player.leaderstats.Coins.Value
end)
You have a typo it would be: player.leaderstats.Coins.Value += 1
But this is just a shorter, more readable version of OP’s way, however, this will not fix the error
I don’t get what you mean by this. can you go to the view tab (in studios) and click the find all tool and search leaderstats and open every script it has a result in