hello im trying to make a less laggy knockback, someone told me i sould use vectorforce but is so hard to work on + i new with vectorforce, so is there other option? that i sould use???.
btw here the script that made the knockback (“velf” and “veltime” are arguments that set the values so dont worry about them)
The script you provided above is perfectly fine, though if you wanted to reduce lag, you should put this on the client if it wasn’t or you could use apply impulse to deal knockback as well.
assuming you want a “knockback” system for combat i’m assuming. This script uses the CFrame of 2 humanoid root parts. short example use of :ApplyImpulse() using 2 CFrames:
local knockback = function(humanoidrootpart, enemy_humanoidrootpart, force)
force = force or 10
enemy_humanoidrootpart:ApplyImpulse((-humanoidrootpart.CFrame.LookVector) * force)
end
Hope this helped, and if you could clarify; What do you mean by laggy?
first up, yes indeed is for combat system, and second is indeed on server side my script and i really scared to switch to client side cuz, exploiters and i dont really know how to make anti cheat code to prevent exploiters use that function, and thrid of all, this is what im refer by laggy:
(when spawning):
(after some seconds or 1 minute):
ima try the script you made so later ima say the results of that
One non-exploitable solution that I just came to think of and MIGHT NOT WORK (feel free to test)
is to set the network ownership on client (which I have NO IDEA whether it is possible or not, technically speaking it probably isn’t.)
To do this you would send fire the part to all clients with a remote event, then change the network ownership to that part.
Keep in mind: There’s an 80% chance this idea won’t work
sorry for being unactive, but i have an idea, i could make a metatable, and make a whole system to make forces, body part, etc. in client side, but i have this issue, that if i make the metatable in server side, and the metatable fires a remote event (fireallclients), can be still laggy?, i know is a dumb question but, talking about if is laggy when the instance is created.
should i make the whole system in client side? (module script where is the metatable).