Why is my script isnt updating?

normally this script here was supposed to check if the boolvalue has been changed and turn textlabels visible or not depending on if its true or false, but for some reason, it only checks once.

local board = script.Parent.SurfaceGui
local fire = game.ReplicatedStorage:WaitForChild("ServerF")

if fire.Value == false then
	board.Firey.Visible = false
	board.FireN.Visible = true
else
	board.FireN.Visible = false
	board.Firey.Visible = true
end

how can I make it so this script always gets updated??

1 Like

You need to connect a signal whenever the Value property is changed. Try this:

local board = script.Parent.SurfaceGui
local fire = game.ReplicatedStorage:WaitForChild("ServerF")

if fire.Value == false then
	board.Firey.Visible = false
	board.FireN.Visible = true
else
	board.FireN.Visible = false
	board.Firey.Visible = true
end

fire.Changed:Connect(function(newValue)
    if newValue == false then
	    board.Firey.Visible = false
	    board.FireN.Visible = true
    else
	    board.FireN.Visible = false
	    board.Firey.Visible = true
    end
end)
2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.