Ok so heres my question, So ive been working on this combat game and I wanna make a new engine that fixes a bunch of messy horrible code, So the game has 3 mechanics: Block, Shove and Light/Heavy Hit, So I need obviously remote events for this kinda thing to work, And I was wondering what would be more efficient since im not a great organizer to be honest.
So number 1
I put the remote events in replicated storage and let a player fire the actions from there and perform everything through there with the player that was sent
Number 2
Put the remote events inside the tools with the listeners and this way i can just do everything easily
Yeah but heres the thing, If I put remote events wouldnt this just create unecesary many scripts, and roblox encourages devs to use as less scripts as possible.
The reason why I am asking this is because I have 2 mayor issues rn, So one is using less scripts, 2 is making everything more organized, And while I could use a module script on my scripts inside the tools something tells me this is just something devs wouldnt do for some reason, Altho there is advantages
For example I can load the animation tracks from the listener script inside the tool so this way I dont have to figure out a mega complex way to save animation tracks from diff players who fired the remotes on replicated storage if i were to put them in there, And also I can check the ammount of times the remote event is fired wich makes a solid thing for anti cheat
Scripts use literally 0 space, they don’t really affect anything, as well as the fact if one thing in a script doesn’t work, nothing else in the script after it works. The short answer, yes, you can use RemoteEvents inside a tool. Is it recommended? No, but if it is necessary, then do it.
I will have to say 1 or 2, it’s really hard as I have done both methods. However you can keep it more organized by using a 1 remote with an argument for the remote’s name or whatever. I wouldn’t really recommend 2 tho.
game:GetService("ReplicatedStorage").Remotes.Event.OnServerEvent:Connect(function(event, arg1, arg2, arg3)
if event == "yes" then
print("yes")
elseif event == "somethingelse" then
print("somethin else")
end
end)