generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Script Help

Previous Thread :: Next Thread 
icanxlr8 is not online. icanxlr8
Joined: 25 Feb 2009
Total Posts: 3686
21 Jul 2012 12:55 PM
I am making a Hunger Games, and so far the only bugs I've noticed is when I play in Online Mode, it only says: No Players. You need 3. Please help.

print 'Hello world!'
function killAll(players)
for i,v in pairs(players) do
if v.Character then
v.Character:BreakJoints()
end
end
end
function teleport(pos)
for k,v in pairs(game.Players:GetPlayers()) do
pcall(function() v.Character:MoveTo(pos) end)
end
end

function over()
local a = Instance.new("Message", Workspace)
local b = game.Workspace.Players:GetChildren()
local c = game.Workspace.TributesLeft
local winnername = script.Parent.WinnerName
a.Text = "The Games are over! The winner is "..winnername.."!"
wait(5)
a:Remove()
killAll()
end

function begin()
local h = Instance.new("Hint", Workspace)
local players = game.Players
local winner = game.Workspace.WinnerName
if players.NumPlayers == 0 then
h.Text = "No Players. You need 3."
if players.NumPlayers == 1 then
h.Text = "Waiting for 2 More Players"
elseif players.NumPlayers == 2 then
h.Text = "Waiting for 1 More Player"
elseif players.NumPlayers >= 3 then
h:Remove()
children.TeamColor = "Bright blue"
killAll()
if winner.Value ~= "winnertest" then
over()
end
end
end
end

begin()
Report Abuse
RobotWallE is not online. RobotWallE
Joined: 17 Jan 2009
Total Posts: 498
21 Jul 2012 01:58 PM
You forgot the elseif in the "if players.NumPlayers==1 then"
If that doesn't rectify it then use "if players.MaxPlayers >= 3 then" start the game BLAHBLAHBLAH!
Report Abuse
icanxlr8 is not online. icanxlr8
Joined: 25 Feb 2009
Total Posts: 3686
22 Jul 2012 02:52 PM
...That sounded odd.
Report Abuse
icanxlr8 is not online. icanxlr8
Joined: 25 Feb 2009
Total Posts: 3686
22 Jul 2012 03:13 PM
Bump
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image