How to keep network ownership physics secure?

So, I am making a soccer game, and basically I am setting the NetworkOwnership to the player. The problem with this is I don’t know how to make it secure to prevent exploiters. For example, an exploiter could just add a bodyVelocity that makes the ball go SUPER fast, or if they want to be “sneaky” they can increase some values by just a tiny amount.

I know with Network Ownership, there is not much you can do, however, I was just wondering what are some of the BARE MINIMUMS that I can do to keep my game a little safer.

My system right now currently sends a request to the server to gain network ownership, then the client just does all the physics.

1 Like

If you haven’t already, take a look at the following Creator Hub post on security.

Security Tactics <-====

2 Likes

Since the request is sent by a server script Filtering Enabled Will block exploiters from changing any values.

2 Likes

you can do something like

local part = script.Parent
local networkowner = part:GetNetworkOwner()

if networkowner and networkowner.Name ~= "Whoever you want the owner to be." then
    local player = game.Players:FindFirstChild("The network owner's name")
    if player then
        part:SetNetworkOwner(player)
    else
        warn("Network owner unavalible")
    end
end
3 Likes

Well obviously I am doing some simple checks on server when they request for network ownership like distance checks, ping checks, but I feel like that is the most that I can do, I just don’t have any other ideas to make it secure.

Definitely server sided physics checks for the ball, by replicating the physics done on the client mathematically on the server plus leeway you can check if the ball is moving too fast or floating etc. If you check who currently has ownership of the ball you can then flag that player for messing with the ball, if you want it to be kept discrete just remove their ownership, don’t think something like rubber banding would work as it would affect other players.

2 Likes

Thanks, I can just do some simple checks like what you said just to make sure the ball isn’t moving too fast, isn’t too high, etc, also What do you mean by “rubber banding”?

Having requests instead of the game setting the network owner is about the same amount of security as if the game were to do it automatically.

2 Likes

Rubber banding means in this case anyway is where you move the ball back to its last position before being messed with but that would affect everyone as exploiters could abuse this to make it impossible to follow/hit the ball

1 Like

Well by “request” I mean sending a remote event to the server to set the network owner to the client that wants to apply bodymovers on the ball

Is the request sent by a local script?

1 Like

Yeah, I will probably just make it so it flags the player in the console, nothing crazy like what you said, this isn’t supposed to be for a “public” game thing that I will publish but its supposed to be a competitive game league kind of thing so I won’t have to go crazy on the punishments, just make it easy to detect if someone is cheating

Yes it is sent by local script, if you want, I can send you the whole place file for game so you can see what my system is like (a little bit of an older version but the same idea)

1 Like

Exploiters can infiltrate a local script to send the request. A serverside script is pretty much impossible to infiltrate on a regular exploit injector.

1 Like

Place.rbxl (200.0 KB)

1 Like

What are you suggesting that I should do? Sorry I am just a little confused, the client just sends a remote event to the server and the server will do some checks before it sets network ownership, the network ownership is handled on the server so yes they cant infiltrate that part like you are saying

Anyways, if you need to see what I mean, I sent a place file for it so you can look into it

image
that’s a server script.

2 Likes

Roblox by default gives the ownership of any unanchored part to the closest player but you should have a check to see if the player who currently has ownership is close enough to the ball if not then remove it. In the link you can see how when the character gets near the ball it becomes green highlighted automatically

1 Like

Yeah, what is your suggestion for me to improve it? I’m a little confused sorry :sweat_smile:

Have the request sent by a server script. That’s way safer for your game.

1 Like