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

Minigame script problem.

Asked by 10 years ago

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

1 answer

Log in to vote
-7
Answered by 10 years ago

When answering, if your answer does not fully solve the question, it should be written as a comment to the question instead of as an 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.

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. TheLuaWeaver 301 — 10y
0
i am giving him some help! Randomplayer121 -2 — 10y
1
You didn't provide a link and you are not supplying much help, you didn't need to leave an answer. FearMeIAmLag 1161 — 10y
Ad

Answer this question