I have a script that makes it so that when one of the stats, insanity, reaches 100, it makes things go all crazy and then the player dies. When I went to test it, it didn't do anything. I went to the output, but it said absolutely nothing. No errors. Script is below. (Also, the insanity increases every 1.5 seconds.)
game.Players.ChildAdded:connect(function(player)
wait(1)
local stats = player.leaderstats
local insanity = stats.Insanity
local scawy = game.Lighting.scarystuff
local scawy2 = game.Lighting.scaryblur
local beat = game.Workspace.insanitbeat
if insanity.Value >= 100 then
beat:Play()
scawy.Enabled = true
scawy2.Enabled = true
wait(8)
player.Character.Humanoid.Health = 0
else
beat:Stop()
scawy.Enabled = false
scawy2.Enabled = false
end
end)
Can somebody tell me how to fix this?
