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

How do you make line 3 to 9 update the string of the GUI text without resetting?

Asked by 8 years ago
local isOn = game.Workspace.DOM.isAvailable -- Location of the bool value

if isOn.Value == false then
    script.Parent.Text = "DOM Check-in(Closed)" -- How do you make this part update the string of the gui text without resetting?
    print("Is not on")
else
    script.Parent.Text = "DOM Check-in(Opened)"
    print("Is on")
end

function on() -- These are just here to let you understand what is going on. Or you can edit them..
    isOn.Value = true
    game.Workspace.DOM.isAvailable.Value = true
    script.Parent.Text = "DOM Check-in(Opened)"
end 

function off()
    isOn.Value = false
    game.Workspace.DOM.isAvailable.Value = false
    script.Parent.Text = "DOM Check-in(Closed)"
end

function Click()    
    if isOn.Value == true then off() else on() end
end

script.Parent.MouseButton1Down:connect(Click)

I have tried while wait(0.5) do but it wont let me toggle the bool value using the button text GUI. Plez halp meh ;-;

Answer this question