How can I join local and server scripts into one? (Moveset Characters)


I looked up into an A Bizarre day Uncopylocked game to inspect the scripts and understand this, but I got really confused on how they scripted it at that time so I decided to make this post.

I am making a fighting game, where you can choose characters to fight with, I want to use one script for the entire moveset but I have no idea how to do it
Maybe whats better is do 1 local script and 1 server script I don’t know, I am not the best here

Another question if you can answer thanks: How can I change idle and walk animations for players with specific characters? Like Soulshatters has many playable characters with different movement animations

1 Like

You can use remote events or functions for this. I think.


Bindable Events and Functions are used to let Server scripts communicate with other server scripts. Remote events and functions are used to let server scripts and local scripts talk and send information to each other. Say I had a textbox and a button. I would need to put a code in the textbox. If I stored this code in the local script, an exploiter could see the code, and put it in. If it was in a server script, this wouldn’t be the case. For example:

--\\ Local Script in a TextButton
local button = script.Parent
local box = script.Parent.Parent.TextBox
   local result = game.ReplicatedStorage.FetchCodeResult:InvokeServer(tonumber(box.Text))

game.ReplicatedStorage.FetchCodeResult.OnServerInvoke = function(Invoker, Code)
   print(Invoker) -- would print the player who had invoked the function
   if Code == 1024 then
      return true

If the code was correct, the result in the local script would be true. You can use this in your case to get information off of the server. Or the server can get info from the client.