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

Why does this script not disable the spotlights?

Asked by 2 years ago

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?

0
Ignore the keycode variable thats for later NICULL897 4 — 2y
0
Do any errors appear in the output? 2_MMZ 1059 — 2y

1 answer

Log in to vote
0
Answered by 2 years ago

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.

Ad

Answer this question