Can someone please proofread my script because I tried it a lot of times and it didn't work. I tried proofreading but that didn't work...
limbs = {'Torso', 'Head', 'Right Arm', 'Left Arm', 'Right Leg', 'Left Leg'} player = {"phriol"} for _,v in pairs(player) do me = game.Players:FindFirstChild(v) if not me then return end mylimbs = me.Character:FindFirstChild(limbs) if not mylimbs then return end mylimbs:remove() end
The first part is right when trying to find the player in the table, but all you need is another for loop to go through each value in the limbs table.
Also, you want to use Destroy instead of remove as remove is deprecated and ROBLOX suggests you use Destroy.
Code:
limbs = {'Torso', 'Head', 'Right Arm', 'Left Arm', 'Right Leg', 'Left Leg'} player = {"phriol"} for _,v in pairs(player) do me = game.Players:FindFirstChild(v) if not me then return end for _,limb in pairs(limbs) do --Loop through each value of the table, _ is the index, limb is the value. mylimbs = me.Character:FindFirstChild(limb) --Check if the limb exists. if not mylimbs then return end mylimbs:Destroy() end end
I hope my answer helped you. If it did, be sure to accept it.
(There was something here, but then i realized you were not new.)
local players = game.Players:GetPlayers() --Function for getting players for _,player in pairs(players) do player.Character:ClearChildren() --Remove all children of the parent. end