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

?How do I check if a workspace on the client side has been deleted

Asked by 4 years ago

So I made a script that when touched it damages the player

but I noticed if the exploiter deleted it on the client side the touch event won't fire is there any way to check?

0
the script has to be on the server AdminAyush 10 — 4y
0
As a general rule, anything that is critical to gameplay (Like damage, movement, etc) should be handled and checked by the server. Do this in a server script. whenallthepigsfly 541 — 4y

1 answer

Log in to vote
2
Answered by
Psudar 882 Moderation Voter
4 years ago

Well as far as I know, you can't exactly "delete" the workspace, but I do think I understand what you're asking about.

To actually detect when something has been deleted, you can use Instance.ChildRemoved or Instance.DescendantRemoving . However, I don't believe this is what you're asking.

I'm guessing you've written some local code that should actually be handled by the server. If that's the case, be sure to use a server script to handle that kind of code.

That could be anything from the server interacting with other users, special conditions that the client shouldn't have control over, etc.

If you need some help grasping the client/server model for roblox, there's actually a decent article on it by Roblox here: https://developer.roblox.com/en-us/articles/Roblox-Client-Server-Model

In your specific case, since the script is damaging players, you should use some code on the server, not on the client.

Ad

Answer this question