Hello!
-
What do you want to achieve? Keep it simple and clear!
-
What is the issue? spotlight disabling when moved in other directions
-
What Did You Try So Far? disabling shadows, rewriting the script a little bit
local RS = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local UIS = game:GetService("UserInputService")
local FlashLight = RS.Assets.FlashLight:Clone()
local LP = game.Players.LocalPlayer
local Weld = Instance.new("Weld")
local Chr = LP.Character or LP.CharacterAdded:Wait()
Weld.Parent = Chr.Head
FlashLight.Parent = Chr.Head
Weld.Part0 = Chr.Head.FlashLight
Weld.Part1 = Chr.Head
print("Light Succesfully Attached On Head.")
UIS.InputBegan:Connect(function(inputObject, process)
if inputObject.KeyCode == Enum.KeyCode.F then
if process == true then return end
FlashLight.SpotLight.Enabled = true
else
FlashLight.SpotLight.Enabled = false
end
end)
I Am still learning luau ![]()