I have a script, which makes a gui visible to all clients if both int values are equal to 1. It isnt working for some reason, and there are no errors in the output.
Server script:
if val.Value == 1 and val1.Value == 1 then
GG:FireAllClients()
else
GSG:FireAllClients()
end
I assume the problem here is that the script is checking if val and val1’s value is equal to 1, but it’s checking only when the script is started. So, maybe add like a BindableEvent when which you’ll fire when the value of any one of them changes.
An example of the server script:
local bindable = Instance.new("BindableEvent")
val.Changed:Connect(function()
bindable:Fire()
end)
val1.Changed:Connect(function()
bindable:Fire()
end)
bindable.Event:Connect(function()
if val.Value == 1 and val1.Value == 1 then
GG:FireAllClients()
else
GSG:FireAllClients()
end
end)
Not sure if this would work though, but a try is at least worth it.