Ok, first off I don't get why you have so many if statements.
if example == 0 and example1 == 0 and example2 == 0 then
You can use if followed by and
In English, this means if all the conditions I state in this line are met, then execute this.
You could also use or if you are trying to give it options.
if example == 0 or example1 == 0 or example2 == 0 then
in English, this means if ANY of the stated conditions are met, then execute what I write below.
An If statement will not constantly keep checking if the parameters are met. They will check once and that is it...that is unless you inclose them in something that will make them check again.
you can use a loop, or a function.
Now I'm going to make an assumption. This is a script inside of a model. That means we can't use .Changed events.
This basically means the best thing I can see to use is a while or repeat loop.
Secondly, you are asking game.StarterGui to make something visible. StartedGui exists only to feed newly joined players a User Interface.
The best thing you can do is use a RemoteEvent and store it in ReplicatedStorage
and have two scripts, a local script and a server script.
local event = game:GetService("ReplicatedStorage").RemoteEvent
while true do
wait(0.01)
if script.Parent.LeverOneLight.Transparency == 0 and script.Parent.LeverTwoLight.Transparency == 0 and script.Parent.LeverThreeLight.Transparency == 0 and script.Parent.LeverFourLight.Transparency == 0 and script.Parent.LeverFiveLight.Transparency == 0 then
game.Workspace.Map1.ExitDoor.Transparency = 1
game.Workspace.Map1.ExitDoor.CanCollide = false
event:FireAllClients()
break
end
end
this next stuff should be in a DIFFERENT script
local event = game:GetService("ReplicatedStorage").RemoteEvent
local player = game.Players.LocalPlayer
event.OnClientEvent:connect(function()
player.PlayerGui.ExitOpened.TextLabel.Visible = true
wait(3)
player.PlayerGui.ExitOpened.TextLabel.Visible = false
end)
Hope this helps. If you don't understand this feel free to leave a comment or try to tag me in the community chat.
2 comments
Search the difference between StarterGui and PlayerGui.
no u (burnedddddddddddddddddd)