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

Flashing light with keycard reader? Tried my best and it did not work

Asked by 5 years ago
workspace.FullAdminOfficeLockdown.touched:connect(function(touch)
        repeat
            script.Parent.SurfaceLight.Enabled=false
            wait(0.5)
            script.Parent.SurfaceLight2.Enabled=true
            workspace["O5-XOffice"].BrickColor=BrickColor.Red()
            workspace["O5-XOffice"].Material="Neon"
            wait(0.5)
            script.Parent.SurfaceLight2.Enabled=false
            wait(0.5)
            script.Parent.SurfaceLight.Enabled=true
            workspace["O5-XOffice"].BrickColor=BrickColor.Gray()
            workspace["O5-XOffice"].Material="Neon"
        until I click a click detector
end)

2 answers

Log in to vote
0
Answered by 5 years ago
local bool = true
local bool2 = true
local clearance = {
    ["[SCP] Card-L5"] = false,
    ["[SCP] Card-L4"] = false,
    ["[SCP] Card-L3"] = false,
    ["[SCP] Card-L2"] = false,
    ["[SCP] Maksur"] = false,
    ["[SCP] Card-L1"] = false,
    ["[SCP] Card-Omni"] = false, 
    ["[SCP] RS Card"] = false,
    ["[SCP] O5-2 Access Card"] = true
}
workspace.FullAdminOfficeLockdown.touched:connect(function(touch)
    if touch.Name == "Handle" and clearance[touch.Parent.Name] and bool then
        repeat
            script.Parent.SurfaceLight.Enabled=false
            wait(0.5)
            script.Parent.SurfaceLight2.Enabled=true
            workspace["O5-XOffice"].BrickColor=BrickColor.Red()
            workspace["O5-XOffice"].Material="Neon"
            wait(0.5)
            script.Parent.SurfaceLight2.Enabled=false
            wait(0.5)
            script.Parent.SurfaceLight.Enabled=true
            workspace["O5-XOffice"].BrickColor=BrickColor.Gray()
            workspace["O5-XOffice"].Material="Neon"
        until workspace.Baseplate.Anchored
    end
end)



Updated script. Still need help

0
Well what the hell do you want help with? You can't just expect us to know. Use print statements, breakpoints and tell us how far it got into the script darn it/1 CyroStorms 4 — 5y
0
Already fixed it tictac67 96 — 5y
Ad
Log in to vote
0
Answered by 5 years ago

Capitalize .touched event perhaps? I don't know if that affects anything but I'm pretty sure it should.

0
Yeah, that's the problem. He doesn't know that .touched is completely deprecated. DeceptiveCaster 3761 — 5y
0
Mate, I fixed it tictac67 96 — 5y

Answer this question