I'm having some trouble with this custom swordscript that I'm working on. It works in test servers/play solo, however not in an actual game. The game is filteringenabled, and the script is inside the tool. I need to be able to get the mouse because I have an option for RightClicking to do a RightSlash/Combo move. Here's the script:
tool = script.Parent
function onEquip()
char = tool.Parent
player = game.Players:GetPlayerFromCharacter(char)
wait(0.2)
mouse = player:GetMouse()
mouse.Button1Down:connect(function() leftslash(mouse) end)
mouse.Button2Down:connect(function() rightslash(mouse) end)
end
tool.Equipped:connect(onEquip)
