How can I have a spotlight I put in the player’s head always aim at the player’s cursor?
here’s my current script;
local function flashlight_Toggle(check)
if check then
flashlightOnSFX1:Play()
spotLight.Enabled = true
playerGui.FlashlightGui.Enabled = true
else
flashlightOffSFX1:Play()
spotLight.Enabled = false
playerGui.FlashlightGui.Enabled = false
end
end
local flashlightMechanic = {}
--//Main
userInputServce.InputBegan:Connect(function(input, gameProccessedEvent)
if input.KeyCode == Enum.KeyCode.F and not gameProccessedEvent then
if not isOn then
isOn = true
flashlight_Toggle(true)
else
isOn = false
flashlight_Toggle(false)
end
end
end)