Hello,
So I’m making it to where when you touch the trigger, the lights flicker a bit but for some reason the trigger isn’t working when touched?
Here’s a clip of what’s going on:
The black part that you can see next to the light is the trigger that is supposed to make the light flicker after touching it. For some reason though when I walk up to it, it does nothing. I’ve already checked the output to see if there was any errors and strange enough there wasn’t.
Here’s how things are set up:
In Workspace
The code inside the script:
local trigger = script.Parent
local light = script.Parent.Parent.Base.PointLight
local brightness = script.Parent.Parent.Base.PointLight.Brightness
local glass = script.Parent.Parent.glass
local transparency = glass.Transparency
local Debounce = false
trigger.Touched:Connect(function(hit)
if not Debounce then
if hit.Parent:FindFirstChild("Humanoid") then
Debounce = true
transparency = 0.2
brightness = 0.4
wait(1)
transparency = 0.4
brightness = 0.3
wait(1)
transparency = 0.6
brightness = 0.2
wait(1)
transparency = 0.8
brightness = 0.1
wait(1)
transparency = 0.2
brightness = 0.4
wait(1)
transparency = 0.4
brightness = 0.3
wait(1)
transparency = 0.6
brightness = 0.2
wait(1)
transparency = 0.8
brightness = 0.1
wait(1)
script:Destroy()
end
end
end)
Not so sure what I’m doing wrong, I’d appreciate anyone who could be kind enough to guide me through or explain a bit!