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?
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.
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 )
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:
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