Make a GUI change depending on a boolean value

I was trying to make a GUI that changes depending on the value of a booleanValue, but it never seems to work. I tried using remote functions, but i’ve never used them before, so i’m having a bit of difficulty. I’ve read trough this roblox page and it helped me a lot, but it still doesnt seem to work.

This is the localscript inside the GUI:

while wait(0.5) do
local adm = game:GetService(“ReplicatedStorage”):WaitForChild(“CheckFunction”):InvokeServer()
if adm == true then
script.Parent.Text = “True”
elseif adm == true then
script.Parent.Text = “False”
end

end

This is the script inside serverscriptservice:

function checking()
local adm = game.ReplicatedStorage.admissions.Value
if adm == true then
return true
elseif adm == false then
return false

end
end

game.ReplicatedStorage.CheckFunction.OnServerInvoke = checking()

Output: (the boolValue is in replicatedStorage)

Any help? Thanks.

On the last line. You’re calling the function checking() so whenever the method :InvokeServer() runs it tried to call that value. You cannot call a boolean value (unless it has a __call metamethod which is not possible on Luau)

The Client Side Script should be like this:

while wait(0.5) do
local adm = game.ReplicatedStorage.admissions.Value
if adm == true then
script.Parent.Text = “True”
elseif adm == false then
script.Parent.Text = “False”
end

end
1 Like