local Temp Temp = workspace:WaitForChild("Temp").Changed:Connect(function(TempCheck) while true do wait(2) if TempCheck == 200 then game.Workspace.Check1.Disabled = true Temp:Disconnect() local Melt = Instance.new("Hint", game.Workspace) Melt.Parent = game.Workspace Melt.Name = 'CoreHot' Melt.Text = '!Core is heating up!' script.Warning1:Play() wait(3) end end end)
How to stop it from looping over and over.
You're using a while true do loop. while true do loops loop over and over again and are unnecessary in this case.
local Temp Temp = workspace:WaitForChild("Temp").Changed:Connect(function(TempCheck) wait(2) if TempCheck == 200 then game.Workspace.Check1.Disabled = true Temp:Disconnect() local Melt = Instance.new("Hint", game.Workspace) Melt.Parent = game.Workspace Melt.Name = 'CoreHot' Melt.Text = '!Core is heating up!' script.Warning1:Play() wait(3) end end)
It isn't very good to place a while true do loop inside an event, as it will no longer listen for it, and keep looping over and over.