I want to blink then turn off all the lights when you touch a part on the floor.
This is what the workspace looks like for a better understanding
Model
Script
Lights
Part
SpotLight
Part
SpotLight
Hit (The part that you touch)
This is the script to turn the lights off
local part = script.Parent
local Light = script.Parent.Lights:GetDescendants("SpotLight")
local hit = script.Parent.Hit
local function onPartTouched(hit)
hit.CanTouch = false
Light.Enabled = false
wait(.2)
Light.Enabled = true
wait(.1)
Light.Enabled = false
wait(.2)
Light.Enabled = true
wait(.2)
Light.Enabled = false
end
hit.Touched:Connect(onPartTouched)

1 comment
yeah, its better to use a for loop in the case