How is my localscript deleting stuff on the server?

So basically I want to make a pickpocket feature for fun, but I don’t want to show that you can pickpocket yourself, so I made a simple script:

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()

function cleanup()
	for _, item in ipairs(character:GetDescendants()) do
		if item:IsA("ProximityPrompt") then
			item:Destroy()
		end
	end
end

cleanup()

character.DescendantAdded:Connect(function()
	cleanup()
end)

But the problem is, it just completely deletes the proximity prompt from the server. I know it’s being created because when I disable the script that deletes the prompt, it works fine. Note that the script that deletes it is a localscript in startercharacterscripts. Does anyone know why this is happening?

1 Like

To make sure it is in a localscript and it’s not appearing. Is it there in the first place?
How are you setting it to the character?

It is in the character. I already said that when I disabled the script there was a proximity prompt.

Can anyone help me? I still can’t figure this out.

When you put a LocalScript inside a character and delete something from that character is replicates to the server I’m pretty sure.

If the proximity prompt is a local script inside the player character then yes it can be deleted by another local script and it would replicate to the server.
I suggest adding an owner check to the pickpocket script instead of deleting/disabling the script. It’s also more secure this way.

If I recall correctly, you have pretty much full control over your own character, and deleting items will make it replicate to the server.

If i remember correctly, all character changes made on the client also replicate to the server. Thats why exploits like speedhacks or fly exist

1 Like

LocalScripts that act on character’s parts show changes to other players too

Because I Guess any Roblox’s character is replicated to the server ( it’s not literally server ) it’s in workspace so when you delete an instances inside your character it effects in the server ( I’m just guessing I’m not sure about that information )

Anything that the client has Network Overship of, that same client can delete. So this goes for folders, hats, baseparts, (any instance).

Client’s have full control over their characters, that’s why when an exploiter deletes their humanoid they die, you can review this thread for more information on player descendants and control over it:

Best way to stop a character (exploiters) from removing their descendants?

I figured it out. i just have to weld another part on the player because you can pretty mcuh delete anything in your character on the client.

this figures out client has to be local script can deleting stuff on server so recently that goes to idea control can review that remove character on the client guess let us know on the server

1 Like