Hi, I’m making my anti part deleter which I’m trying to use for instances on my character, this is for personal use and I know about the anti tamper api for characters.
its basically supposed to see if something was removed from someone character and if so it will reload them and tp them back to their og position. its supposed to check for individual ones.
local char = game.Players.AmericanEagle124579.Character
local check_for = {
"Torso",
"HumanoidRootPart",
"LeftLeg",
"RightLeg",
"RightArm",
"LeftArm",
"Head",
"CuteBlush2Accessory",
"Fedora",
"Skiis",
"VoidAntlers",
"Ultra-Fabulous Hair",
"Vibe Check Baseball Bat",
"Gold Rectangle Shades",
"Shirt",
"Pants",
"Star Slayer Railgun"
}
local plrran = false
local hrppos
game.Workspace.ChildRemoved:Connect(function(ChildRemoved)
if ChildRemoved.Name ~= table.concat(check_for," ") then
return
end
if plrran then
return
end
hrppos = char.HumanoidRootPart.CFrame
game.Players.AmericanEagle124579:LoadCharacter()
char.HumanoidRootPart.CFrame = hrppos
plrran = true
wait()
plrran = false
end)
You probably meant to use workspace.DescendantRemoved. Make sure the player who had an instance removed is you, though. Otherwise it could cause errors.
local Hats = {
"Torso",
"HumanoidRootPart",
"LeftLeg",
"RightLeg",
"RightArm",
"LeftArm",
"Head",
"CuteBlush2Accessory",
"Fedora",
"Skiis",
"VoidAntlers",
"Ultra-Fabulous Hair",
"Vibe Check Baseball Bat",
"Gold Rectangle Shades",
"Shirt",
"Pants",
"Star Slayer Railgun"
}
local Players = game:GetService("Players")
local CS = game:GetService("CollectionService")
function Check(Child:Instance?, Player:Player?)
local Name = tostring(Child)
if table.find(Hats, Name) then
for _,v in Hats do
if v:lower():match(Name:lower()) then
local Position = Player.Character.HumanoidRootPart.Position
Player:LoadCharacter()
Player.Character:MoveTo(Position)
task.wait()
Position = nil
break
end
end
end
end
Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
Character.DescendantRemoving:Connect(function(Child)
if not CS:HasTag(Player, "CDH") then
CS:AddTag(Player, "CDH")
Check(Child, Player)
task.delay(2,function()
CS:RemoveTag(Player, "CDH")
end)
end
end)
end)
end)