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

Why does this close so many of parts instead of just 1 of each??

Asked by 7 years ago
local player = game.Players.LocalPlayer
local mageval = script.Parent.Parent
script.Parent.MouseButton1Click:connect(function(changecostume)
    local characterpart = player.Charachter:GetChildren()
    for i,v in pairs(characterpart()) do
        if v.ClassName == "CharacterMesh" then 
            v:remove()
        else
            print("NotAPart")
        end
    end
    wait(2)
    local costumechose = player.Costumes.Skeleton:GetChildren()
    for i,v in pairs(costumechose()) do
        if v.ClassName == "CharacterMesh" then 
            local clone = v:clone()
            clone.Parent = player.Character
        else
            print("NotAPart")
        end
    end
end)

why does this clone so many of the same parts? Do I need to add a debounce?

0
If you don't want it to be spamable then you need a debounce Im_Kritz 334 — 7y
0
I tried doing that? PullAnAllNighter 8 — 7y
0
Line 14, 'costumechose()' -- why do you have a parenthesis? User#13152 0 — 7y

Answer this question