Here's the script.
local UserInputService = game:GetService("UserInputService")
local player = game:GetService("Players")
UserInputService.InputBegan:Connect(function(InputObject, GameProcessed)
if (GameProcessed) then return end
if (InputObject.KeyCode == Enum.KeyCode.E) then
local character = player.LocalPlayer.Character
local flashlight = character:findFirstChild("Flashlight")
flashlight.SpotLight.Enabled = not flashlight.SpotLight.Enabled
print("KLIK")
end
end)
The script is initially disabled(Cuz I made it disabled). The script is enabled after the player touches a brick. However, the script doesn't work until the player resets. How do I overcome this?

1 comment
oof