How would you make a Combat System with different classes?

I’m working on a roblox project just for fun, and I wanted to make a Combat System.

I’ve done something similar before but since It was all handled by the server… somethings I disliked.

My main issue is… How would the game handle giving different moves/skills to each class?

Using UserInputService I can detect when the player presses a key, but how would I handle the action being different from pressing the same key with another class? And how would I transfer the info to the server? What would be the most efficient way?

I tried having different UserInputService LocalScripts, and cloning them to the player depending on which class they chose, but I remembered that cloning scripts into things is not usually a good idea.

(I hope I was able to explain what I'm trying to achieve correctly, it is complex)

I would highly appreciate some advice! :disappointed_relieved:

use ContextActionService:BindAction() and pass it to an action handler (either within the script itself or a ModuleScript placed somewhere in ReplicatedStorage) that defines what to do with different classes and stuff
to have it replicate to the server use RemoteEvents and RemoteFunctions that a script in ServerScriptService listens to and handles appropriately

I see, I didn’t know about ContextActionService, I’ll look more into it, the hard part will be making use of a ModuleScript as even tho I do know how they work, im not sure how to use them in this situation

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.