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

Why are they dieing?

This script spawns the character in a random location then all of a suddenly they started spawning dead.~~~~~~~~~~~~~~~~~


  local civN = script.CivilianN.Value
while civN > 0 do
	civN = civN - 1
	person = game.Lighting.People.Civilian:Clone()
        person:MakeJoints()
	person.Parent = game.Workspace
end

1 answer

✓ Accepted answer

Looks

Firstly, I am going to code block your code and make it readable.

local civN = script.CivilianN.Value 
while civN > 0 do 
	civN = civN - 1 
	person = game.Lighting.People.Civilian:Clone() 
	person:MakeJoints() 
	person.Parent = game.Workspace 
end

The problem

You are making their joints before they have made it into workspace

Here is a fixed version

local civN = script.CivilianN.Value 
while civN > 0 do 
	civN = civN - 1 
	person = game.Lighting.People.Civilian:Clone() 
	person.Parent = game.Workspace 
	person:MakeJoints() 	
end

I hope this helped you

1 comment

0

Thank you.

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