hey i have a localscript inside a tool but it only works when the player first spawned in, after players death or reset it just seems to stop working completely with no error but in studio it works fine
game logs:
studio logs:
local uis = game:GetService('UserInputService')
local remote = script.Parent:WaitForChild('Remote')
uis.InputBegan:Connect(function(input, active)
if (input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch) and not active then
print('FIRED BEGAN')
remote:FireServer('down', getPlayerMouseLoc())
end
end)
uis.InputEnded:Connect(function(input, active)
if (input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch) and not active then
print('FIRED ENDED')
remote:FireServer('up', getPlayerMouseLoc())
end
if script.Parent.Parent:IsA('Model') and input.KeyCode == Enum.KeyCode.Q then
if script.Parent.Spells:FindFirstChild('Protego') then
remote:FireServer('Qpressed', getPlayerMouseLoc())
end
end
end)