Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How does this break my script?

		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 ;/

3 comments

0

capitalize the C in ":Clone()"

3

^ Nope. It works with both.

0

It's not anything that will solve your problem, but I suggest you put the objects in ServerStorage instead of Lighting.

4 answers

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

4 comments

2

OHHHH yeah ;S forgot about that but I still think it won't work let me try it

1

"game.Workspace.Lighting" That could be the cause

1

Oh yeah thankyou! I completely forgot haha.

0

Did it work?

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.

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! :)

2 comments

0

Table.insert must ONLY use two arguments*

0

That's weird, I get no error for having 3 and it's always worked with this

This discussion is preserved as it was. New answers, comments, and votes are closed.