Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

What would happen if a client does not have a part and a server script tries to affect it?

I am making a game where you can make your own little mini games that are too small to be in the actual games tab of roblox, but not in my game. So I wanted to make it so that a client (with FE on) can delete someones place on their side when they are making it so they experience less lag in case they are doing anything that is laggy. But I want to know what would happen if like 5 clients have someone's place up and 1 client does not and a server script affects it. Would it make it pop back up for the one client who does not have it? Would it make the server script error? Heres what would make that.

--dis is a localscript if you could not tell.
workspace["hiimgoodpack's Place"]:Destroy()

Also, if a client doesnt have it but it pops up back for the client, would it get affected by a server script? Or would it just not be affected?

--another localscript
game:GetService('ReplicatedStorage')["hiimgoodpack's Place's Copy"]:Clone().Parent = workspace

Remember, Filtering Enabled is on.

1 answer

✓ Accepted answer

If the server creates it and a client deletes it, the server will still always see it as still being there, however, the client won't. If the client changes it, nothing will happen to the server script. However, the client will be affected by changes you make via the client. It's like changing your ROBUX via HTML in Chrome 'Inspect'. ROBLOX won't register that change as anything because the server didn't request that change, it was done by you, which ROBLOX verifies via the server.

Changes to the client via the client affect you in certain ways. Is the server looking for something you deleted via a LocalScript? That won't affect the server. Are you looking for something you deleted via a LocalScript? That affects anything local you try doing, but not the server.

Changes to the server via the client don't affect the server.

What would happen if a client does not have a part and a server script tries to affect it?

It depends on who deleted the part. If the server deleted the part, the part would be deleted from the server and client. If the client deleted the part, the server would still see it as being there. The part can still be edited by the server.

2 comments

0

And what if the client added the model back? Also, Inspect Element is not a chrome only feature

0

I didn't know if Firefox called it something else. If the client added the model back, the server wouldn't register it, so the server would still just be editing the original one. The server isn't going to start editing or be able to find the one you added back. This is where RemoteEvents/Functions come in to play. You use them to cross the client-server bounds. 

This discussion is preserved as it was. New answers, comments, and votes are closed.