Serverside character position is different from the client

I mean you could check every second whether the Player’s position on the server is the same as on the client and set it to that (but this is extremely risky because any client can spoof the system).

You could use a sanity check to determine if the amount of studs the client has moved is reasonable. But honestly I’m too tired to do the math… sorry :frowning:

I can tell you’re testing right now (and the game isn’t public) so you could probably get away with this:

local rF = game.ReplicatedStorage.remoteFunction

task.spawn(function()
while task.wait(2.5) do
local cCFrame = rF:FireClient(serverCFrame)
-- cCFrame returns the Client’s CFrame
if cCFrame ~= serverCFrame then
plr.Character.HumanoidRootPart.CFrame = cCFrame
end
end
end)

I may be asleep by the time you respond. I’ve been responding to a lot of DevForum posts within the last few hours. Sorry in advance :frowning:

Sorry for not responding,why is the position even different? All the stuff is moving on the serverside

I’m not sure, never ran across this type of problem because well, I’ve never done anything related to this before. I don’t really have any suggestions but to well, maybe wait it out or test it in the actual game (like not in Studio).

I found the bug while i was trying to test the the actual game,so that wouldn’t work.
Does waiting out means wait for a bugfix?

Probably you would sadly. Since most of us aren’t regulars, we can’t really post but reports.

Tween the CFrame instead of position. If you select the model you will notice the bounding box is larger as the hrp is disconnected.

Do i need to tween the entire model CFrame or just the humanoidrootpart CFrame?

Models don’t have CFrames, you’d only be able to Tween the HumanoidRootPart’s CFrame (or other parts in your Character).

You should put the vaulting script on the client, as movement for your player is done on the client.

There is also something called “lag”, where the it takes time for the client to tell the server where you are, so on the server you are a few steps behind than on the client. This gets bigger with higher ping.

Wouldn’t it be really vulnerable to exploits?

Putting it on a remote event makes it more vulnerable.

It wouldn’t be any more vulnerable than it is already - exploiters could already make their own custom vaulting scripts if they wanted.

cc: @ZestyIsSour exploiters can already do whatever they want with their character.

Client calculates the character’s physics and because of this server has to wait client’s calculated position. You can get client’s position with InvokeClient or make vaulting script on the client.

That’s also very true. But putting it on a remote event just makes it even more vulnerable

Why though? Isn’t it good that the server is handling all the stuff and not the client?

Handling everything on the server worsens the ping for the server the player is on. And it can also cause memory leaks.

There’s no point trying to secure it that way, the best thing to do is to verify that the client moved the correct distance after vaulting, not to do the vaulting itself as that would be really laggy for the players with high ping.

Not in this case. Handling movement on the server without a whole lot of other complicated tricks on the client will just make moving around feel slow and choppy.

I was referring to a different reply, but it’s always good to inform those that don’t know anyway :hugs:

There is no point is what I am trying to say. Doing it on the client can reduce memory leaks and just calculate the operations on the CPU. It may reduce FPS, but it is better than the whole server shutting down.

Oh, alright. Thanks for letting me know

So the best solution to this problem is just doing all of these on the client.
It’s best to do this to reduce memory leaks and lag.

It will also be smoother when you do it on the client. So it doesn’t look like you have low FPS.