Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
-1

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

Asked by 3 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 — 3y
0
I tried doing that? PullAnAllNighter 8 — 3y
0
Line 14, 'costumechose()' -- why do you have a parenthesis? JohnnyMorganz 185 — 3y

Answer this question