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

Most efficient way to do such a thing?

Asked by
Veyrek 5
7 years ago
Edited 7 years ago

Let's say I have an costume, and it's in pairs(such as boots, arms, basically 2 things). I have something that checks whether it is an pairs costume item or not, but what's the most efficient way to check the 2 items, let's say I have right leggings, and left leggings, is there a way to check the both items if it contains the particular string "leggings" whilst ignoring the first string which is whether "left" or "right", but this doesn't only apply to leggings, everything that has similiar surname string, such as left "arm" and right "arm",I've been told I should use formatting aswell..?

function acquireCostume(costumeId)
    assert(costumeId, "Acquiring a nil costume!")

    local costumes = Resources.Models.Costumes
    local costume = costumes[costumeId]:clone()
    costume.Parent = pseudoChar

    if costume then
        local stats = _G.Module:LoadSpecificModule(costume, "Stats")
        local costumeCf = stats.costumeCf
        local type = stats.type
        local model = costume.Model

        table.insert(equippedCostumes, costumeId)

        for i, par in pairs(model:GetChildren()) do
             _G.Weld:autoWeld(model.Main, par)
            local costumeWeld = _G.Weld:weld(model.Main, pseudoChar[type])
            costumeWeld.C0 = costumeCf
            if stats.pairs then

            end
        end

        for k, v in pairs(equippedCostumes) do -- testing purposes
            print(v)
        end
        return costume      
    end
end

1 answer

Log in to vote
0
Answered by
Veyrek 5
7 years ago

Bump, need to get this done...

Ad

Answer this question