In my game players should get +1 Power on the leaderboard for bouncing on a trampoline I made. I created a trampoline by anchoring a part and changing its y-velocity. The bouncy part is also a part of a model made up of multiple parts if that makes a difference, but I have also already tried the script with plain bricks and had no luck.
game.Players.PlayerAdded:connect(function(player)
local debounce = true
script.Parent.Touched:connect(function()
local plrstats = player.leaderstats.Timer
if debounce then
debounce = false
plrstats.Value = plrstats.Value +1
wait(2)
debounce = true
end
end)
end)
I am also providing my leaderboard script in case it is useful.
game.Players.PlayerAdded:connect(function(player)
local Stats = Instance.new("Model", player)
Stats.Name = "leaderstats"
local Timer = Instance.new("IntValue", Stats)
Timer.Name = "Power"
Timer.Value = 0
end)

3 comments
Because in the First Script, you refer to it as "Timer" and in the Second, it is set as "Power"
the player function will update to a new player as soon as someone new joins
Thank you