Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Verifying if a part exists on the server side?

Asked by 2 years ago
Edited 2 years ago

So basically lately I have been needing to verify if a part actually existed

and so I was gonna try and rely solely on the client on if a model exists inside of a server to which I thought of

basically sending the entire model from the client and having the server just verify using

if Part.Parent == Folder then

Server side




RemoteEvent.OnServerEvent:Connect(function(Player, Part) if Part.Parent == Folder then -- Do things with the part because it exists -- Any other verifications or sanity checks I need to do? Part.Position = end end)

Client side

local Part = workspace.Part



game.ReplicatedStorage.RemoteEvent:FireServer(Part)

Basically I just want to check if the part actually exists on the server so that I can do anything on the server

And to my information this is not exploitable because it is checking the part on the server side

so basically it needs to exist on the server side first

so even if exploiters fire a fake part

it will find the client part as nil meaning it is not exploitable

does anyone else have any other concerns of this script?

Here is what I think will happen when someone tries to exploit

BECAUSE THE PART DOES NOT EXIST INSIDE OF THE SERVER WHEN THE SERVER CHECKS FOR THE FOLDER

IT WILL SHOW UP AS NIL BECAUSE THE PART ITSELF IS NIL

THEREFORE THIS IS THE BEST WAY TO GO ABOUT IT AND THE CLEANEST

1 answer

Log in to vote
0
Answered by
manith513 121
2 years ago

When using this in very specific things that are going on in your game, yes it looks fine, however if you start doing more things that are client side only such as animating and other things that cause server lag, you will need to change it or create a “whitelist” with the names of instances that are allowed to only exist client side however you need to be specific. Otherwise, when trying to check if a remote fired had an exploited part that the server should have, then your code looks fine.

Ad

Answer this question