I have a value and I want the script to do something when the value goes up to 40 although I can't figure out how to do it. I started by making a serverscriptservice and made it insert a script into the players script folder which would say
while true do
wait(1)
local hi = script.Parent,Parent:WaitForChild("leaderstats")
if hi.H == 40 then print("yayayyayay")
end)
end)
After that I deleted the serverscript script and put the player script folder in the starter player script folder. I have tried many other things but the script doesn't work and isn't printing hi my leaderstats is at 40 and no error message is being outputted! I wolud be great-full if someone would help me.

3 comments
Where should I put this script? Thanks for the answer!
In a Script inside of ServerScriptService.
Thank you so much!