Here is the script where I want it to give you 5 coins when you touch the part
local player = game.Players:GetPlayerFromCharacter()
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
player.leaderstats:FindFirstChild("Coins")
Coins.Value = 5
end
end)
And then the leaderboard script
game.Players.PlayerAdded:Connect(function(player)
local stats = Instance.new("IntValue",player)
stats.Name = "leaderstats"
money = Instance.new("IntValue",stats)
money.Name = "Coins"
end)
