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

How does this break my script?

Asked by 10 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.
        if #game.Players:GetChildren() == 1 then
            for i,v in pairs(game.Players:GetChildren()) do
                v.Character:MoveTo(game.Workspace.spawns:findFirstChild(i).Position)
                table.insert(alive,#alive+1,v)
                _G.game = true
                game.Workspace.Lighting.FingerLazers:clone().Parent = v.Backpack
                if v.Character.Humanoid.Health > 0 then
                    track_death(v)
                else
                    died(v)
                end
            end
            repeat wait(1) until done
            done = false
        else
        message = Instance.new("Message", game.Workspace)
        message.Text = "Too many players have left! Waiting for more to start the game..."
        wait(3)
        message:Destroy()
        end
    end
end

When-ever I put

game.Workspace.Lighting.FingerLazers:clone().Parent = v.Backpack

In the script, it doesn't give me the Finger Lazers like I want it to from lightning, and the game doesn't end.

When I remove that 1 line, everything works fine but I need the Finger Lazers ;/

0
capitalize the C in ":Clone()" FearMeIAmLag 1161 — 10y
3
^ Nope. It works with both. User#11893 186 — 10y
0
It's not anything that will solve your problem, but I suggest you put the objects in ServerStorage instead of Lighting. Aethex 256 — 10y

4 answers

Log in to vote
3
Answered by
SNOWFKE 25
10 years ago

I'm pretty sure Lighting isn't in Workspace.

2
OHHHH yeah ;S forgot about that but I still think it won't work let me try it User#2154 0 — 10y
1
"game.Workspace.Lighting" That could be the cause SNOWFKE 25 — 10y
1
Oh yeah thankyou! I completely forgot haha. User#2154 0 — 10y
0
Did it work? SNOWFKE 25 — 10y
Ad
Log in to vote
0
Answered by
Mowblow 117
10 years ago

Maybe you could try a quick local instead of doing it directly. For example:

local g = game.Lighting.FingerLasers:Clone()
g.Parent = v.Backpack -- Note, backpack has only one capital letter, this gets me a lot.
Log in to vote
0
Answered by 10 years ago

Table.insert must one use two arguments. You've put in 3. You could perhaps do:

table.insert(alive,{#alive+1,v})

And, where is track_death and all the other functions from, please tell me and what is in the function. Thanks! :)

0
Table.insert must ONLY use two arguments* 12packkid 0 — 10y
0
That's weird, I get no error for having 3 and it's always worked with this User#2154 0 — 10y
Log in to vote
-4
Answered by 10 years ago

because you didnt do a please on the end

0
Oh, erm please? :P User#2154 0 — 10y

Answer this question