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

Shirts and Pants Won't Be Destroyed Through Script?

Asked by 6 years ago

I'm running it through a server-side script, and I've tried every possible method I could think of. Regardless, here's the script.

wait(10)
for i,v in pairs(game.Teams["CLE Cavaliers"]:GetPlayers())do
        if v:FindFirstChild("Pants") then
            v.Pants:Destroy()
        end
        local b = Instance.new("Pants")
        b.PantsTemplate = "http://www.roblox.com/asset/?id=854306032" 
        b.Parent = v
    end
    for i,v in pairs(game.Teams["GS Warriors"]:GetPlayers())do
        if v:FindFirstChild("Pants") then
            v.Pants:Destroy()
        end
        local b = Instance.new("Pants")
        b.PantsTemplate = "http://www.roblox.com/asset/?id=854306307" 
        b.Parent = v
    end
    for i,v in pairs(game.Teams["CLE Cavaliers"]:GetPlayers())do
        if v:FindFirstChild("Shirt") then
            v.Shirt:Destroy()
        end
        local b = Instance.new("Shirt")
        b.ShirtTemplate = "http://www.roblox.com/asset/?id=854305833" 
        b.Parent = v
    end
    for i,v in pairs(game.Teams["GS Warriors"]:GetPlayers())do
        if v:FindFirstChild("Shirt") then
            v.Shirt:Destroy()
        end
        local b = Instance.new("Shirt")
        b.ShirtTemplate = "http://www.roblox.com/asset/?id=854306146" 
        b.Parent = v
end

If you want to you can condense it. But nothing seems to be working. The script just passes through it. I don't want to kill them, cause I do have other scripts that whenever a player joins, depending on a certain value during the game, their shirt and pants will be destroyed and be replaced with a uniform. Please help! Thanks.

-LukeGabrieI aka EnergyBrickz

1
Is FE on? Bellyrium 310 — 6y
1
OHH, shirt and pants are in the CHARACTER not the player. Bellyrium 310 — 6y
1
I would recommend you check to see if each player has a character. if so change the value of the shirt and pants to a new ID. I know for sure that works, I change outfits by just changing ID. Bellyrium 310 — 6y
1
you know you dont have to destroy and replace them, you could just set the Template and done! outlook1234567890 115 — 6y
0
yea lol, it's complicated LukeGabrieI 73 — 6y

Answer this question