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

Whats wrong with this LocalScript?

Asked by
iLegitus 130
10 years ago
--[iLegimate]--

Player = game.Players.LocalPlayer


BodyParts = Player:GetChildren()

for i,b in pairs("BodyParts") do
if (b.className == "CharacterMesh") or (b.className == "Shirt") or (b.className == "Pants") or (b.className == "ShirtGraphic") then
b:Remove()
else
    return nil
        end
    end

I tried that but its saying :

19:16:43.290 - Script 'Players.Player.Backpack.PlayerConfiguration', Line 8 19:16:43.291 - Stack End

1 bad arguments to 'pairs' (table expected,got string)

Can anyone help,Im basically trying to do,Once the player's character has loaded,It runs the scrpt and if it finds any packages,shirts,pants or t-shirts then it removes them.

1 answer

Log in to vote
0
Answered by 10 years ago
-- The problem is the script seen the " and started to run the table as a string, but you need it to run a table so all you need to do is remove the "
Player = game.Players.LocalPlayer


BodyParts = Player:GetChildren()

for i,b in pairs(BodyParts) do
if b.className == "CharacterMesh" or b.className == "Shirt" or b.className == "Pants" or b.className == "ShirtGraphic" then
b:remove()
else
end
    end

0
This script will also need to be in StarterGui or Starterpack in order to run correctly. MessorAdmin 598 — 10y
0
Startergui = Playergui and Starterpack = Backpack if you didnt know. ;D MessorAdmin 598 — 10y
0
Ty iLegitus 130 — 10y
Ad

Answer this question