|
| 29 Nov 2013 04:49 PM |
function text(m, p, ti, ty) coroutine.wrap(function() local te = Instance.new(ty, p) te.Text = m wait(ti) te:Destroy() end)() end
while wait(15) do if (game.Players.NumPlayers < 2) then repeat text('Not enough players: at least two needed (' .. game.Players.NumPlayers .. ').', game.Workspace, 3, 'Message') wait(3) until game.Players.NumPlayers >= 2 end
local maps = game.Lighting.Maps:GetChildren() local map = maps[math.random(1, #maps)]:clone() map.Parent = game.Workspace map:MakeJoints()
text('Chosen map: ' .. map.Name, game.Workspace, 3, 'Message')
local players = game.Players:GetPlayers() _G['it'] = players[math.random(1, game.Players.NumPlayers)].Character
text('The Golden One is ' .. _G.it.Name .. '!', game.Workspace, 3, 'Hint') _G.it.Humanoid.WalkSpeed = 25 _G.it.Humanoid.MaxHealth = 500 _G.it.Humanoid.Health = 500 local time = 120
repeat time = time - 1 wait(1) until time == 0 or _G.it.Humanoid.Health == 0
if (_G.it.Humanoid.Health == 0) then text('The Golden One has been slain!', game.Workspace, 3, 'Message') else text('The Golden One has survived for two minutes!', game.Workspace, 3, 'Message') end wait(3) map:Destroy() text('Intermission', game.Workspace, 15, 'Hint') end
It won't run after the choosing part, not sure why as it doesn't come up with errors. Help? |
|
|
| Report Abuse |
|
|
| |
|
Azarth
|
  |
| Joined: 17 Aug 2012 |
| Total Posts: 2760 |
|
|
| 29 Nov 2013 06:00 PM |
| Coroutine is a natural pcall, try commenting that out and see if you get an error. |
|
|
| Report Abuse |
|
|
|
| 29 Nov 2013 06:00 PM |
| Well, there is an error or it wouldn't work but the output doesn't show anything. |
|
|
| Report Abuse |
|
|
| |
|
Azarth
|
  |
| Joined: 17 Aug 2012 |
| Total Posts: 2760 |
|
|
| 29 Nov 2013 06:02 PM |
| Like I said, if there's a problem and your coroutine is letting it through, it won't print to output. Comment it out to see if there's a problem that your coroutine is preventing you from seeing. |
|
|
| Report Abuse |
|
|
|
| 29 Nov 2013 06:03 PM |
| Just testing it... kid of lagging. Thanks for the help. |
|
|
| Report Abuse |
|
|
|
| 29 Nov 2013 06:06 PM |
Workspace.Main:7: unexpected symbol near ')' Eh... |
|
|
| Report Abuse |
|
|
|
| 29 Nov 2013 06:09 PM |
Hah, finally showing up. Workspace.Main:29: attempt to index field 'it' (a nil value) Not sure why...
|
|
|
| Report Abuse |
|
|
Azarth
|
  |
| Joined: 17 Aug 2012 |
| Total Posts: 2760 |
|
|
| 29 Nov 2013 06:12 PM |
_G.it.Name --Isn't there, figure out why. I'd give more help, but I can't set up a test environment for this.
|
|
|
| Report Abuse |
|
|