So I’m making a hitbox system and to make it a bit safer I’m doing everything server side. The only thing that I’m doing client side is one thing, is that it gives the player’s position to the server; I know this is very risky so is there a way to make a server side check to see if it matches?
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I tried getting the velocity and ping server side and check to see if the client position is similar to other server position + added velocity and ping. But it’s very unreliable
Edit: Reason why I get player position from client is so there’s no delay
When the client-side fires the remotes, it always passes through the player. So instead of passing through the player’s position through the client-side you can just get it through the server-side using Player.Character, through the passed Player argument.
If im reading this right, the “other” player’s position on the server is something like this? player.Character:GetPivot() or player.Character.HumanoidRootPart.CFrame or player.Character.PrimaryPart.CFrame
Also i woudnt recommend sending position data from remotes as remote data can be spoofed really easly via hookmetamethod on executors.
Yes, so basically you don’t have to pass through the player’s position through the client because that is unreliable.
You can just directly get the player’s accurate position, after they have passed through the Player you can get their Character model from the server.
You should just grab the player’s position directly on the server
local Character = Player.Character or workspace:FindFirstChild(Player.Name) -- Whichever method works best
local Position = Character.HumanoidRootPart.CFrame -- Player character's CFrame
If I understand correctly, are you essentially wanting to have server authoritative characters? If so, it might be worth checking out chickynoid as it could very easily validate positions server side
this wouldn’t matter as the character’s network ownership belongs to the client, so the client deciding that their character is now 10000 studs in the air would go through to the server just fine
I do not know anything about doing checks on a player character’s position to make sure they are not exploiting, but trying to validate a position sent from the client seems more of a hassle than just grabbing it directly from the server and then validating it
I mean yeah in this case there is no need to send it from the client you are correct. Just thought the question was more trying to prevent exploiting which would need a more complicated solution
however woudnt having server authoritative characters cause latency issues? I think OP should just have a loop to check the player’s last position vs the current position magnitude and if its over a threshold lagback to last position
I’m pretty sure chickynoid is specifically designed to not have latency, as it’s meant to be used in things like fps games. I highly doubt this would be a problem with an actual implementation lol
Roblox doesn’t do server authoritative characters because they are harder to work with and require more networking than giving network ownership to the player. Both have different use cases and one is much more niche than the other.