It's 6am and I've been working all night on this project of mine, I hope I can get some assistance.
This script appears to completely crash the game, on the second if statement. Heat gets to 49, and studio just flat out stops. Didn't break until I put the first if statement in, which was added when I wanted it to be able to tell if the heat was lower than that value as well.
Heat is a numvalue, shield-related parts are parts and unions, zap are deadly scripts.
Any help?
h = Instance.new('Hint')
local Shield,KillShield,KillShield2 = script.Parent.Shield, script.Parent.KillShield, script.Parent.KillShield2
local Heat = workspace.Generator.Core.Heat
local Node = workspace.Generator.Node
while true do
if Heat.Value < 50 then
wait(1)
h.Parent = game.Workspace
h.Text = "[ Generator Heat: " .. Heat.Value .. " ]"
Shield.Transparency = 0.8
KillShield.Zap.Disabled = false
KillShield2.Zap.Disabled = false
else if Heat.Value >= 50 then
h.Text = "[ WARNING: Generator Overheated! ]"
Shield.Transparency = 1
KillShield.Zap.Disabled = true
KillShield2.Zap.Disabled = true
end
end
end
