0

# 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()
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")
wait(5)
if game.Players.NumPlayers>=reqplr then
wait(3)
randommap()
end
end
end
end
end

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. Unclear 1776 — 7y
0
Ok, I've shortened it. truefire2 75 — 7y
0
Your error is outside of the code that you've provided. Unclear 1776 — 7y
0
This line is apparently the problem : script.Parent.Text = ""..i truefire2 75 — 7y
0
Put the whole script so that we can see what line 42 is Azgarok 3 — 6y

-7