What do you want to achieve? I want to be able to do damage with a weapon without using a tool, I am in the process of making a system, but I’ve run into a problem.
You have to get the mouse through the client not the server, the server cant access input and such, so your going to have to use something called a remote event which lets you speak between the client and the server, just pass over the mouse too the server script
You cannot and most definitely should not handle input on the server. Every button you press will feel the ping. Do everything input related client side as much as you can, only relay what you have to.
In this case, you can relay the touched event. Or handle the touched event on the server in a separate script.
Also, while we’re on the subject, you should never connect to the same event more than once. In this case, you want to create the event outside of the Slash function.
function slash()
slash = true
do stuff
wait(.5)
slash = false
end
touched:connect(function(hit)
if slash then
tell server damage is dealt
end
end
The reason I am not using a tool is because I have the sword welded to the startercharacters arm, also I find using tools in pvp to be kinda scuffed, so I want to make a system where you just always have it out, also having the tool gui hidden would mess around with my future plans for this game.
You can’t pass the mouse to the server. You can tell the server that the player clicked, but I’m serious, this is something you want to be handled locally as much as possible.