RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"add lighting to part on touch"
-- script for part local part = script.Parent local lightEnabled = false local function toggleLight(otherPart) local player = game.Players:FindFirstChild(otherPart.Parent.Name) if player and not lightEnabled then lightEnabled = true local pointLight = Instance.new("PointLight") pointLight.Parent = part pointLight.Brightness = 5 pointLight.Range = 10 wait(5) pointLight:Destroy() lightEnabled = false end end part.Touched:Connect(toggleLight)