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

What is wrong with my @spire command?

Asked by
IcyEvil 260 Moderation Voter
10 years ago

Im trying to make it when you say '@spire/' that it puts fire and sparkles on you at the same time.

if msg:lower():sub(1,7) == "@spire " then
    local plrz = GetPlr(plr, msg:lower():sub(8))
    for i, v in pairs(plrz) do
        coroutine.resume(coroutine.create(function()
            if v and v.Character and v.Character:findFirstChild("Torso") then
                for z, xd in pairs(v.Character.Torso:children()) do if xd:IsA("Fire") then xd:Clone()
                    for x, xd in pairs(v.Character.Torso:children()) do if xd:IsA("Sparkles") then xd:Clone()
                    end
                end
                end
                end
            end
        end
    end --')' expected to close '(' at line 26 near end

but when I do that it says the same thing.

1 answer

Log in to vote
0
Answered by 10 years ago

You forgot a few ends in a few places, and coded one thing wrong, but I was able to fix it so that it didn't have any errors;

if msg:lower():sub(1,7) == "@spire " then
local plrz = GetPlr(plr, msg:lower():sub(8))
for i, v in pairs(plrz) do
coroutine.resume(coroutine.create(function()
if v and v.Character and v.Character:findFirstChild("Torso") then
for z, xd in pairs(v.Character.Torso:children()) do if xd:IsA("Fire") then xd:Clone() end end
for x, xd in pairs(v.Character.Torso:children()) do if xd:IsA("Sparkles") then xd:Clone() end end
end
end))
end
end

Hope this helped!

Ad

Answer this question