I am trying to make a sword but the problem is I need it to block and for that I need to detect when the player is right-clicking and I was wondering if there is anyway to do this with a server script or if local scripts will work for tools (as in replicate on the server)
You should check the RoClans Sword from my profile. There is no block system but that is a bit more complicated to add then I can answer on this forum.
You can use UserInputService to check what the player is doing to interact such as right clicking.
I am aware of UserInputService I am just worried that this will make the process of blocking harder/overcomplicated as Local Scripts can’t run in workspace so I would need to have an remote event
Indeed. Though you can technically avoid it by playing the animation on the client and checking if an animation is being played on the server.
Pretty sure animations are replicated but realistically you should be using a remote event for what you plan to do.
Use a local script and remotes. Fire the remote event when the player starts holding right click, as well as when they stop holding right click. Make a value inside the player’s character when the player is blocking and delete it when the player stops blocking. And also edit the sword script to not damage a player if the value is detected.
Wouldn’t an exploiter be able to abuse this?
That’s why I recommended my RoClans sword. Swords are very exploitable. Mine prevents most exploiter related issues with swords.
No, you can add server sided cooldowns
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.