Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why doesn't the UI change/start a meltdown when it reaches over or under temperatures?

Asked by 3 years ago

tested it many times, only "UNSTABLE" works WHAT IS WRONG WITH THE SCRIPT

while true do
    wait(0.1)
    if game.ServerStorage.Temperature.Value <= 250 then
        script.Parent.Reader.TextColor3 = Color3.new(0.0431373, 1, 0.0431373)
        script.Parent.Reader.Text = "STABLE"
    elseif game.ServerStorage.Temperature.Value <= -250 then
        script.Parent.Reader.TextColor3 = Color3.new(0.0588235, 0.435294, 1)
        script.Parent.Reader.Text = "COLD"
    elseif game.ServerStorage.Temperature.Value >= 250 then
        script.Parent.Reader.TextColor3 = Color3.new(1, 0.972549, 0.12549)
        script.Parent.Reader.Text = "UNSTABLE"
    elseif game.ServerStorage.Temperature.Value >= 1200 then
        script.Parent.Reader.TextColor3 = Color3.new(1, 0.427451, 0.0941176)
        script.Parent.Reader.Text = "WARNING: OVERHEATING"
    elseif game.ServerStorage.Temperature.Value >= 2000 then
        script.Parent.Reader.TextColor3 = Color3.new(1, 0, 0)
        script.Parent.Reader.Text = "DANGER: NEAR MELTDOWN"
    elseif game.ServerStorage.Temperature.Value <= -1200 then
        script.Parent.Reader.TextColor3 = Color3.new(0.168627, 0.0235294, 1)
        script.Parent.Reader.Text = "FREZEING"
    elseif game.ServerStorage.Temperature.Value >= 2400 then --meltdown
        game.ServerStorage.Temperature.Value = game.ServerStorage.Temperature.Value + 325812435
        script.Parent.Reader.TextColor3 = Color3.new(0.32549, 0.0470588, 0.666667)
        script.Parent.Reader.Text = "MELTDOWN"
        print("Meltdown Initated")
        local Text = game.StarterGui.t.system
        local Note = game.StarterGui.t.Note

        Text.Visible = false

        wait(3)
        Text.Visible = true
        Text.Event.Text = "MELTDOWN"
        Text.InfText.Text = "Warning, core tempetures are significantly high. Please prepare for a meltdown."

        script.MeltdownIntroAnnouncement:Play()
        wait(9)
        Text.Visible = false
        script.CoreOverheatingSound:Play()
        workspace.Core.Main.Emitter.Enabled = true
        wait(3)

        script.Alarm:Play()
        script.Lights:Destroy()
        script.PowerFailureSound:Play()
        script.Supports.q.Anchored = false
        script.Supports.w.Anchored = false
        script.Supports.e.Anchored = false
        script.Supports.r.Anchored = false
        script.Supports.t.Anchored = false
        script.Supports.y.Anchored = false
        script.Supports.u.Anchored = false
        script.Supports.i.Anchored = false
        script.Supports.breakSound:Play()
        script.ExplosionFile1:Play()
        wait(8)
        script.bridge.fallsound:Play()
        script.bridge.floor.Anchored = false
        script.bridge.glass.Anchored = false
        script.Decetor.p1.Anchored = false
        script.Decetor.p2.Anchored = false
        script.Decetor.p3.Anchored = false

        wait(100)
        Text.Visible = true
        Text.Event.Text = "Shutdown"
        Text.InfText.Text = "Attention staff, the choice to shutdown the core will expire in 5 minutes."
        Text.InfText.Text = "This core will explode in 7 minutes."
        Text.Visible = false
        script.song:Play()
        wait(300)
        script.Self_Destruct:Play()
        Text.Visible = true
        Text.InfText.Text = "Shutdown has expired, Evacuate NOW!"
        wait(9.3)
        script.Self_Destruct:Pause()
        Text.Visible = false
        wait(120)
        local ColorCorrection = game.ReplicatedStorage.ColorCorrection:Clone()
        ColorCorrection.Parent = game.Lighting

        local Blur = game.ReplicatedStorage.Blur:Clone()
        Blur.Parent = game.Lighting

        script.CoreExplosion:Play()
        script.RoaringNuke:Play()
        script.Nuke.Transparency = "0"
        print("Core exploded")

        --nuke
        local tweenservice = game:GetService("TweenService")

        local part = script.Nuke

        local target = Vector3.new(1100.2, 1100.2, 1100.2)

        part.Size = Vector3.new(30, 30, 30)

        local tweenInfo = TweenInfo.new(
            20, -- Time the tween takes
            Enum.EasingStyle.Linear, -- EasingStyle
            Enum.EasingDirection.In, -- EasingDirection
            0, -- How many times you want it to repeat
            false, -- Reverse
            0.1 -- Delay
        )

        local tween = tweenservice:Create(part, tweenInfo, {Size = target})

        tween:Play()
        wait(30)
        for i, v in pairs(game.Players:GetChildren()) do
            if v then
                v:Kick("Meltdown has caused the facility to be unstablized. Thank you for playing.")
            end
        end
    end
    wait(1)
end
0
What's the magic word? MiAiHsIs1226 189 — 3y

1 answer

Log in to vote
1
Answered by
pwx 1581 Moderation Voter
3 years ago

The client cannot access ServerStorage, I suggest you check on the server then FireAllClients() in order to change what's on a UI.

0
At least I assume it's working on a UI and not a Billboard. Also, I advise you change while true do to Value.Changed. pwx 1581 — 3y
0
why do I need a FireAllClients()?? wdym? please explain, idk what you even explained Mister33j 86 — 3y
0
it works, somehow i found the problem but thanks Mister33j 86 — 3y
Ad

Answer this question