Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why does this script not disable the spotlights?

So since i decided to make my own car lights script and i want it to be inside the vehicle seat or just anywhere inside the car. Using a local script, i added 2 spotlights in 2 different meshparts.

local LeftHL = script.Parent.Parent.Body["Rogue Paramount Coupé 300"].FLH.SpotLight
local RightHL = script.Parent.Parent.Body["Rogue Paramount Coupé 300"].FRH.Spotlight
local LightsButton = Enum.KeyCode.L

LeftHL.Enabled = false
RightHL.Enabled = false

This should make it so that they turn off when i enter the vehicle seat, right?

2 comments

0

Ignore the keycode variable thats for later

0

Do any errors appear in the output?

1 answer

✓ Accepted answer

Sometimes items don't replicate fast enough. You can use :WaitForChild, :FindFirstChild, and others so errors are not thrown

If there are no errors, and the problem is that other clients can't see it, you may need to use a remote event to make it appear on the server.

This discussion is preserved as it was. New answers, comments, and votes are closed.