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

Minigame script problem.

Hi. I've created an automated minigames script, which has a few problems. The players respawn in some random place the first time, then die, then spawn at the right place, which is bad, since I want them to be spawned at a spawn location first time round. Also, the timer doesn't work. Also, another glitch is that sometimes, the player repeatedly spawns outside the map.

Thank you. The output doesn't say anything but this "Players.Player1.PlayerGui.timer.Frame.timetext.Script:42: attempt to index field 'Parent' (a nil value)"

function respawn()
	for i, v in pairs(game.Players:GetPlayers()) do
		coroutine.resume(coroutine.create(function()
			v:LoadCharacter()
			end))
		end
	end


function timer()
	respawn()
if game.Workspace.MapHolder:GetChildren()[1]~= nil then
		for i = timelim, 0, -1 do
			wait(1)
			script.Parent.Text = i -- this line
			end
				script.Parent.Text = "Time up!"
				for i,v in pairs(game.Players:GetPlayers()) do
					if v.TeamColor ~= BrickColor.new("Bright yellow") then
						v.TeamColor = BrickColor.new("Bright yellow")
						v:LoadCharacter()
						wait(5)
						if game.Players.NumPlayers>=reqplr then
							wait(3)
				randommap()
					end
				end
			end
		end
end

5 comments

0

Use the output or your general knowledge to isolate your problem. Dumping a huge amount of code isn't a good way of asking for help.

0

Ok, I've shortened it.

0

Your error is outside of the code that you've provided.

0

This line is apparently the problem : script.Parent.Text = ""..i

0

Put the whole script so that we can see what line 42 is

1 answer

wow. Nice script!! Anyways, I don't really have an answer. But maybe ask peaspod on roblox. He answered me before. Or comment on one of his videos on his YouTube Channel: 'PeasFactory'. I hope this helps.

3 comments

1

Do not use this system like this. There are comments for a reason, and if you can't comment, it's because you don't use the website properly.

0

i am giving him some help!

1

You didn't provide a link and you are not supplying much help, you didn't need to leave an answer.

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