Hello! Am trying to make this script check if the player took his tool out. How would I get the game check if the player is holding it? This is a script and not localscript!
while wait(1) do
if script.Parent.Front.SurfaceLight.Enabled == true then
if script.Parent.FlashlightScript.FlashlightBattery.Value > 0 then
script.Parent.FlashlightScript.FlashlightBattery.Value -= 1
else
script.Parent.Front:WaitForChild("SurfaceLight").Enabled = false
script.Parent.Light:WaitForChild("Light").Enabled = false
script.Parent.Light:WaitForChild("Shadow").Enabled = false
end
end
if script.Parent.Parent == player.Character then
script.Parent.Front:WaitForChild("SurfaceLight").Enabled = false
script.Parent.Light:WaitForChild("Light").Enabled = false
script.Parent.Light:WaitForChild("Shadow").Enabled = false
else
script.Parent.Front:WaitForChild("SurfaceLight").Enabled = true
script.Parent.Light:WaitForChild("Light").Enabled = true
script.Parent.Light:WaitForChild("Shadow").Enabled = true
end
end