I’m wondering if I’m doing something wrong or if this is a bug.
Even with no lag enabled in studio, I do this :
Fire event to server (skill begin)
Compute position to reach
Tween player cframe to the position (tween.Completed:Wait())
Fire event to server (skill end)
And even when the server is just do print on the character position, the problem is that they are the same between OnServerSkillBegin and OnServerSkillEnd. Except if I add a task.wait(x) before firing the second event.
What is this sorcery?
I’m kinda rolling my head on the keyboard. Don’t tell me both action communicate in parrallel? Or is it because I use the CFrame ?
Thanks anyway !
(Btw it’s because I have a dash skill and I want to make sure the player didn’t cheat, while being responsive… so “physic” on the client side)
I suppose there is no way around it. You can’t possibly know when the character’s position will be replicated, so it is basically unreliable. You should do the character’s movement on the server instead. Try and look for the most optimized solution (VectorForce perhaps? Or maybe ever LinearVelocity…)
With Roblox’s current character system, the client will always have authority of their character physics so I don’t think its worth trying to make an anti cheat for a dash ability. I think the best choice would be to handle all of it on the client.
The dash was just the basic example of a movement ability, it works for everything.
Well after been really sad, I think my only solution is to implement the shadow system I was thinking about. Which means that when the starting event is received by the server, it activate a clone of the player doing the same thing that the player should be doing. The shadow become the target for hits, and at the end the delta between the shadow and the player is computed and some other logic is applied. Basically the server is the only truth, triggered by the first event.