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

How can I make a door open when five lights are neon/activated?

Asked by
Qu_xtty -8
4 years ago
Edited by Ziffixture 4 years ago
    ErnestaLightOn = false
    DanLight2On = false
    AquiziviteLight3On = false
    LovelyLightOn = false
    QuinnKennithLightOn = false

    if ErnestaLightOn == true and DanLightOn == true and AquiziviteLightOn == true and LovelyLightOn == true and QuinnKennithLightOn == true then
         local DarklightDoor = script.Parent
         if game.Workspace.ActivationLights.Material == Enum.Material.Neon then
            game.Workspace.DarklightDoor.Transparency = 1 
            game.Workspace.DarklightDoor.CanCollide = false
            game.Workspace.PlayOpening()
        end
    end
end

If you know why this isn't working, post it in the answers. Anyways, here is an example of what I'm trying to do, so you can fix my script. I want the door to become transparent and CanCollide = false when ErnestaLight, DanLight, AquiziviteLIght, LovelyLight, and QuinnKennithLight are neon/activated. Please help! (For a myth game)

0
Any information given in the output? Ziffixture 6913 — 4y
0
What do you mean Feahren? Qu_xtty -8 — 4y
0
are there any errors/ warinings? marine5575 359 — 4y
0
the last end has a red line under it, and in the output it says "Workspace.DarklightDoor.Script:21 Expected <eof> got end Qu_xtty -8 — 4y
View all comments (2 more)
0
That means you're trying to close a scope that was never created; remove the third end keyword, there are only two if scopes. Ziffixture 6913 — 4y
0
But then two of the light names have a red underline under them. Qu_xtty -8 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
ErnestaLightOn = false
DanLight2On = false
AquiziviteLight3On = false
LovelyLightOn = false
QuinnKennithLightOn = false


if ErnestaLightOn == true and 
DanLightOn == true and
AquiziviteLightOn == true and
LovelyLightOn == true and
QuinnKennithLightOn == true then
    local DarklightDoor = script.Parent
     if game.Workspace.ActivationLights.Material == Enum.Material.Neon
        then game.Workspace.DarklightDoor.Transparency = 1 
        game.Workspace.DarklightDoor.CanCollide = false
        game.Workspace.PlayOpening()


    end
end

As we can see the top variables don't match the bottom one. When scripting you have to remember you are working with a robot so everything must match as it won't just go and fix a simple problem for you.

ErnestaLightOn = false
DanLightOn = false
AquiziviteLightOn = false
LovelyLightOn = false
QuinnKennithLightOn = false


if ErnestaLightOn == true and 
DanLightOn == true and
AquiziviteLightOn == true and
LovelyLightOn == true and
QuinnKennithLightOn == true then
    local DarklightDoor = script.Parent
     if game.Workspace.ActivationLights.Material == Enum.Material.Neon
        then game.Workspace.DarklightDoor.Transparency = 1 
        game.Workspace.DarklightDoor.CanCollide = false
        game.Workspace.PlayOpening()


    end
end

This is the fixed script unless you intentionally put the numbers into the script

0
DanLight has a red underline under it. Qu_xtty -8 — 4y
0
Does the script run though, we need to see the error log you are receiving in order to fix the problem HSlightsteel 14 — 4y
Ad

Answer this question