Server/Client sided questions

So I have a game where the player can do missions to earn cash/exp etc…

I have a mission where up to 30 zombies try to run at you, and you have to defend them off with a mounted turret. Because of the fact that this mission could in theory be done at the same time by at least 8 players at once. That would be some heavy load for the server. So I decided to make this mission entirely client sided.

The zombies and turret are all running client sided. But my original idea was to make 8 separate areas for players to each do this mission. But then I realized, and this is where my question is. If I spawn in the turret, and move the player via local script, and spawn the zombies locally. Can I just use 1 area?

How does that work, if I move a player to a position with a local script. Is he only there on his client? What happens if he starts moving afterwards, what does the server see?

If you move a player’s position using a local script, the client will only see that. The server will see no changes.

You should not worry handling those tasks to the server. Making them client-sided opens a lot of problems.

I am 90% sure that when the player moves no matter if a local script does it, it’ll change on the server / for every other client

1 Like

Anything done client-side is only visible to the local player.

I suggest you to take a look at the documentation about client/server runtime

3 Likes

I should clarify a bit. The game is a shopping mall overun with zombies. In the mall alone there will be something 200 zombies walking around with AI.

If in theory another 8 players have 30 zombie npcs running around, 8 * 30 → 240 more npc’s. I think that will cause some issues for me. So I thought making it client sided would be better. Also, if this theory I have works then I only need 1 area for this mission instead of making multiple * max player slots.

Okay, I guess if I move the player via client. Then I just lock his player somewhere on the server, and unlock him/move him on client.

I think this is because of network ownership.

1 Like

Hm I swear that I read in a post that when a player is moved in any sort of fashion, it would replicate over to the server

Nope nevermind I’m dumb…. Yeah

I think for players the ownership of their character is set to thr local player and for everything else its defaulted as server but if a player sits in a vehicle seat then it will give the network ownership to the player that sits

1 Like

Yeah nope yeah I’m dumb. If the server had network ownership of a player it would be choppy. My bad.

Ah shoot, you mean to say that if a vehicle seat has an occupant (even if created on client) then the server will update his position? Cause I was planning on making 1 mounted turret for each player on client, and then seating their player also on client.

Well wouldn’t you be able to set the network ownership to the client again?

@Modern_Developer2201

Haha yeah, i learnt that the hard way trying to figure out why my train stopped when i jumped out without setting the velcoity to 0

1 Like

I think both the aerver and client has to see a part for it to have ownership? Maybe im not sure

I’m pretty sure that if a part is close enough to a client’s network ownership range, the client will get network ownership of the part.

There’s a setting in studio that lets you visualize network ownership but I forgot what it’s called. It should be in Studio Settings

I’ll just start up a local server and find out. Thanks

1 Like

Im not sure about the first part but yeah theres a setting to let you visualize it

1 Like

So, looks like a seat created locally, the client can’t interact with it at all. The seat is essentially visual and not physical. Can walk right through it, no interaction.

1 Like