I have a tool that has a localscript that works fine in studio even after death but in game its fine too but breaks when i reset/die, with no errors or anything being deleted
heres the print in studio
and here in game (stops printing after i die)
the script:
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)```