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

I don't how to say it?. But you might understand if you look at the problem i have.

Asked by 3 years ago
Edited 3 years ago

So I have a local script in startergui:

local UIS = game:GetService("UserInputService") local Reasure = 'Running'

UIS.InputBegan:Connect(function(input, gameProcessedEvent) if input.UserInputType == Enum.UserInputType.Keyboard then if input.KeyCode == Enum.KeyCode.F then print(Reasure) end end end)

so what it basically does is it is supposed to activate and deactivate a light(the light is a spotlight in a part named light called L1) in a StarterCharacter model I have made. I want the light to deactivate but I don't know how to script it. The StarterCharacter model is in StarterPlayer and I tried this line of script:

local Light = game.StarterPlayer:WaitForChild("StarterCharacter")

but then I don't how to include the Light so then I tried this:

local Light = game.StarterPlayer.StarterCharacter.Light.L1

so then later on I added a keybind:

if Input.KeyCode == Enum.KeyCode.F then Light.Enabled = false
end

but it doesn't work so does FindFirstChild so i need help. Thx for reading.

0
Likely because it's client-sided. Try this on the server using a RemoteEvent or RemoteFunction. DeceptiveCaster 3761 — 3y
0
CODE BLOCK. Dovydas1118 1495 — 3y
0
but im also not sure which line of code is right though BACONSBOUNTY 0 — 3y

Answer this question