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.