✓ Accepted answer
Hey there! I recommend not using a repeat wait() for this because it will just run uselessly.
Instead, you can use GetPropertyChangedSignal.
Here's how :
local player = game.Players.LocalPlayer
local leaderstats = player:WaitForChild('Leaderstats')
leaderstats.Level:GetPropertyChangedSignal('Value'):Connect(function()
if leaderstats.Level.Value == 5 then
script['Level000Congrates']:Play()
end
end)
Make sure this is a local script, and make sure the leaderstats name is 'Leaderstats' (with a capital L)
1 comment
Thank you so much!