Hello! Ive been working on some fighting game mechanics and Im really stuck on this one part.
So on the server when the player joins they get a controller assigned to them. The controller keeps track of cooldowns, and moves which the player can perform by using a custom method i made which binds them to the controller. Then actually when its time to perform a move it checks if the player has that move binded. Pretty simple stuff.
Now this is all server sided, And usually my move framework i used to do was remote events and user inputs or context action service. Now every remote event is different between every move, “Punch” has a remote event which listens to the players mouse input. Heres the problem i want this to work on the client too. I want a system where you can bind inputs to functions kind of passed from the server. Yet i have no idea what the client should do right now, im completely lost.
fire a remote event which sends the binded moves when the binded moves are set? Im really struggling to find what the problem your having is exactly please send more of your code
Im not on pc so im rewriting it sorry for the formatting.
local Moveset = {}
Moveset.__index = Moveset
function Moveset.CreateProfile(player)
local self = setmetatable({}, Moveset)
self.Moves = {}
--other unnecessary info
return self
end)
function Moveset:BindMove(MoveName:string,
Cd:number)
local Move = {}
Move.Name = MoveName
Move.Cooldown = Cd
Move.LastTick = tick
self.Moves[MoveName] = Move
end)
function Moveset:CheckMove(MoveName:string)
if self[MoveName] then
return true
else
return false
end
end)
return Moveset
Should give you more of an idea
this is done in the back end (server) and i wanted to be able to bind moves on the client with the use of remote events but the clienr knows which remote event belongs to that move or which function to carry out.