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
 

I little help please...

Previous Thread :: Next Thread 
TheJKid is not online. TheJKid
Joined: 22 Oct 2009
Total Posts: 5202
09 Aug 2011 08:27 AM
Ok sorry about so much code here, but yesterday I was told to put the whole script in, or else they can't help me. So, here's the problem. The Bit where it says "who's won & if no one has won or if a few people have won" message does not show up.

I'm not sure why but there's no error. I was wondering if you could help me figure it out.

Thanks!

The script
--------------------------------------------------------------------------------------
while true do
wait(5)
local m = math.random(1,1)

msg = Instance.new("Message")
hnt = Instance.new("Hint")
msg.Parent = nil
hnt.Parent = nil
if m == 1 then
msg.Parent = game.Workspace -
hnt.Parent = game.Workspace
hnt.Text = "Time untill Next Game: 15"
wait(1)
hnt.Text = "Time untill Next Game: 14"
wait(1)
hnt.Text = "Time untill Next Game: 13"
wait(1)
hnt.Text = "Time untill Next Game: 12"
wait(1)
hnt.Text = "Time untill Next Game: 11"
wait(1)
hnt.Text = "Time untill Next Game: 10"
wait(1)
hnt.Text = "Time untill Next Game: 9"
wait(1)
hnt.Text = "Time untill Next Game: 8"
wait(1)
hnt.Text = "Time untill Next Game: 7"
wait(1)
hnt.Text = "Time untill Next Game: 6"
wait(1)
hnt.Text = "Time untill Next Game: 5"
wait(1)
hnt.Text = "Time untill Next Game: 4"
wait(1)
hnt.Text = "Time untill Next Game: 3"
wait(1)
hnt.Text = "Time untill Next Game: 2"
wait(1)
hnt.Text = "Time untill Next Game: 1"
wait(1)
hnt.Parent = nil
msg.Text = "Choosing Boot Camp Minigame." --A bunch of messages to tell you that the game is starting which you can change if desired
wait(1)
msg.Text = "Choosing Boot Camp Minigame.."
wait(1)
msg.Text = "Choosing Boot Camp Minigame..."
wait(1)
msg.Text = "A Boot Camp Minigame has been chosen!"
wait(3)
msg.Text = "The Boot Camp Minigame is..."
wait(3)
msg.Text = "Balance Test"
wait(0.5)
msg.Text = "Balance Test!"
wait(0.5)
msg.Text = "Balance Test!!"
wait(0.5)
msg.Text = "Balance Test!!!"
wait(2)
msg.Text = "Get Across The Balance Course Before the Time Runs Out! Don't fall! You have 3 Minutes" --Instructions
wait(5)
msg.Text = "Difficulty Rating: Really Hard" --Rating
wait(5)
msg.Text = "The game will be starting in:"
wait(1)
msg.Text = ".....5....."
wait(1)
msg.Text = "....4...."
wait(1)
msg.Text = "...3..."
wait(1)
msg.Text = "..2.."
wait(1)
msg.Text = ".1."
wait(1)
msg.Text = "GO!"
wait(1)
Players = game.Players:GetPlayers()
for i = 1, #Players do
if Players[i] ~= nil then
l = game.Workspace.BalanceTest.Tele -- The Start
Players[i].Character:MoveTo(l.Position)
end
end

msg:remove()
--The Minigame Script! .............................................

--------------------------------------------------------------------
wait(10) --How long the game lasts
winners = { }

msg.Parent = game.Workspace

msg.Text = "The Minigame has ended" --After the game ends, this shows a message/messages at the end. Edit if you want.
wait(2)
for i = 1, #Players do
if Players[i] ~= nil then
if Players[i]:FindFirstChild("Winner") ~= nil then
if Players[i].Winner.Value == 1 then
table.insert(winners, Players[i].Name)
Players[i].leaderstats["Total Points"].Value = Players[i].leaderstats["Total Points"].Value + 1 -- The Amount you win
Players[i].leaderstats["Sever Points"].Value = Players[i].leaderstats["Sever Points"].Value + 1
end
end
end
end
wincount = 0
for fgh = 1, #winners do
wincount = wincount +1
end
if wincount >1 then
msg.Text = table.concat(winners, ", ").." Have Won, they each recive a Point"
elseif wincount == 1 then
msg.Text = table.concat(winners, "").." Has Won, and recives a Point"
elseif wincount == 0 then
msg.Text = "Nobody has won"
end
wincount = 0
winners = { }
msg:remove()
Players = game.Players:GetChildren()
for i = 1, #Players do
if Players[i] ~= nil then
if Players[i].Character ~= nil then
Players[i].Character:MoveTo(game.Workspace.LobbyTele.Position)
end
end
end
for i = 1, #Players do
if Players[i] ~= nil then
if Players[i]:FindFirstChild("Winner") ~= nil then
Players[i].Winner.Value = 0
end
end
end

end
end


Report Abuse
TheJKid is not online. TheJKid
Joined: 22 Oct 2009
Total Posts: 5202
09 Aug 2011 08:59 AM
Anyone?
Report Abuse
bikerking300 is not online. bikerking300
Joined: 31 Mar 2010
Total Posts: 1034
09 Aug 2011 09:01 AM
I thought you fixed it..
Report Abuse
TheJKid is not online. TheJKid
Joined: 22 Oct 2009
Total Posts: 5202
09 Aug 2011 09:14 AM
bikerking300
This is a new problem.
Report Abuse
bikerking300 is not online. bikerking300
Joined: 31 Mar 2010
Total Posts: 1034
09 Aug 2011 09:14 AM
ohh..
Report Abuse
TheJKid is not online. TheJKid
Joined: 22 Oct 2009
Total Posts: 5202
09 Aug 2011 09:18 AM
bikerking300
So.. Think you could help me?
Report Abuse
bikerking300 is not online. bikerking300
Joined: 31 Mar 2010
Total Posts: 1034
09 Aug 2011 09:22 AM
Change
msg = Instance.new("Message")
hnt = Instance.new("Hint")
msg.Parent = nil
hnt.Parent = nil
if m == 1 then
msg.Parent = game.Workspace -
hnt.Parent = game.Workspace
hnt.Text = "Time untill Next Game: 15"
wait(1)
hnt.Text = "Time untill Next Game: 14"
wait(1)
hnt.Text = "Time untill Next Game: 13"
wait(1)
hnt.Text = "Time untill Next Game: 12"
wait(1)
hnt.Text = "Time untill Next Game: 11"
wait(1)
hnt.Text = "Time untill Next Game: 10"
wait(1)
hnt.Text = "Time untill Next Game: 9"
wait(1)
hnt.Text = "Time untill Next Game: 8"
wait(1)
hnt.Text = "Time untill Next Game: 7"
wait(1)
hnt.Text = "Time untill Next Game: 6"
wait(1)
hnt.Text = "Time untill Next Game: 5"
wait(1)
hnt.Text = "Time untill Next Game: 4"
wait(1)
hnt.Text = "Time untill Next Game: 3"
wait(1)
hnt.Text = "Time untill Next Game: 2"
wait(1)
hnt.Text = "Time untill Next Game: 1"



To



msg = Instance.new("Message",Workspace)
hnt = Instance.new("Hint",Workspace)
msg.Parent = nil
hnt.Parent = nil
if m == 1 then
for i =10,0, -1 do
hnt.Text = "Time untill Next Game: "..i
end -- ends the for loop.
Report Abuse
TheJKid is not online. TheJKid
Joined: 22 Oct 2009
Total Posts: 5202
09 Aug 2011 09:24 AM
That's not the bit that I have a problem with, but it's neater.

Report Abuse
bikerking300 is not online. bikerking300
Joined: 31 Mar 2010
Total Posts: 1034
09 Aug 2011 09:27 AM
I knoe im shorting it and finding the problem.
Report Abuse
bikerking300 is not online. bikerking300
Joined: 31 Mar 2010
Total Posts: 1034
09 Aug 2011 09:31 AM
Oh i made a mistake here Change

msg = Instance.new("Message",Workspace)
hnt = Instance.new("Hint",Workspace)
msg.Parent = nil
hnt.Parent = nil
if m == 1 then
for i =10,0, -1 do
hnt.Text = "Time untill Next Game: "..i
end -- ends the for loop.

to

msg = Instance.new("Message",Workspace)
hnt = Instance.new("Hint",Workspace)
msg.Parent = nil
hnt.Parent = nil
if m == 1 then
for i = 10,0, -1 do
wait(1)
hnt.Text = "Time untill Next Game: "..i
end -- ends the for loop.
Report Abuse
TheJKid is not online. TheJKid
Joined: 22 Oct 2009
Total Posts: 5202
09 Aug 2011 09:35 AM
Ok
Report Abuse
bikerking300 is not online. bikerking300
Joined: 31 Mar 2010
Total Posts: 1034
09 Aug 2011 09:37 AM
Wow a 146 lined code is now down to 76 lines of code..




while wait(5) do
local m = math.random(1,1)
msg = Instance.new("Message",Workspace)
hnt = Instance.new("Hint",Workspace)
msg.Parent = nil
hnt.Parent = nil
if m == 1 then
for i = 10,0, -1 do
wait(1)
hnt.Text = "Time untill Next Game: "..i
end -- ends the for loop.
msg.Text = "Choosing Boot Camp Minigame." --A bunch of messages to tell you that the game is starting which you can change if desired
wait(3)
msg.Text = "A Boot Camp Minigame has been chosen!"
wait(3)
msg.Text = "The Boot Camp Minigame is..."
wait(3)
msg.Text = "Balance Test"
wait(4)
msg.Text = "Get Across The Balance Course Before the Time Runs Out! Don't fall! You have 3 Minutes" --Instructions
wait(5)
msg.Text = "Difficulty Rating: Really Hard" --Rating
wait(5)
for i =5,0, -1 do
wait(1)
msg.Text = "Time untill Game Starts: "..i
end
msg.Text = "GO!"
wait(1)
Players = game.Players:GetPlayers()
for i = 1, #Players do
if Players[i] ~= nil then
l = Workspace.BalanceTest.Tele -- The Start
Players[i].Character:MoveTo(l.Position)
msg.Text = ""
end end end
wait(10)
winners = { }

msg.Parent = game.Workspace

msg.Text = "The Minigame has ended"
wait(2)
for i = 1, #Players do
if Players[i]:FindFirstChild("Winner") ~= nil then
if Players[i].Winner.Value == 1 then
table.insert(winners, Players[i].Name)
Players[i].leaderstats["Total Points"].Value = Players[i].leaderstats["Total Points"].Value + 1 -- The Amount you win
Players[i].leaderstats["Sever Points"].Value = Players[i].leaderstats["Sever Points"].Value + 1
end end end

wincount = 0
for fgh = 1, #winners do
wincount = wincount +1
end
if wincount >1 then
msg.Text = table.concat(winners, ", ").." Have Won, they each recive a Point"
elseif wincount == 1 then
msg.Text = table.concat(winners, "").." Has Won, and recives a Point"
elseif wincount == 0 then
msg.Text = "Nobody has won"
end
wincount = 0
winners = { }
msg:remove()
Players = game.Players:GetChildren()
for i = 1, #Players do
if Players[i] ~= nil then
if Players[i].Character ~= nil then
Players[i].Character:MoveTo(game.Workspace.LobbyTele.Position)
end end end
for i = 1, #Players do
if Players[i] ~= nil then
if Players[i]:FindFirstChild("Winner") ~= nil then
Players[i].Winner.Value = 0
end end end end end
Report Abuse
TheJKid is not online. TheJKid
Joined: 22 Oct 2009
Total Posts: 5202
09 Aug 2011 09:39 AM
Thanks did you fix it?
Report Abuse
bikerking300 is not online. bikerking300
Joined: 31 Mar 2010
Total Posts: 1034
09 Aug 2011 09:42 AM
Idk test it.
Report Abuse
TheJKid is not online. TheJKid
Joined: 22 Oct 2009
Total Posts: 5202
09 Aug 2011 09:53 AM
I fixed a few errors.
The bit where it says who has won still does not show up.

while wait(5) do
local m = math.random(1,1)
msg = Instance.new("Message",Workspace)
hnt = Instance.new("Hint",Workspace)
msg.Parent = nil
hnt.Parent = nil
if m == 1 then
for i = 10,0, -1 do
wait(1)
hnt.Parent = Workspace
msg.Parent = Workspace
hnt.Text = "Time untill Next Game: "..i
end -- ends the for loop.
msg.Text = "Choosing Boot Camp Minigame." --A bunch of messages to tell you that the game is starting which you can change if desired
wait(3)
msg.Text = "A Boot Camp Minigame has been chosen!"
wait(3)
msg.Text = "The Boot Camp Minigame is..."
wait(3)
msg.Text = "Balance Test"
wait(4)
msg.Text = "Get Across The Balance Course Before the Time Runs Out! Don't fall! You have 3 Minutes" --Instructions
wait(5)
msg.Text = "Difficulty Rating: Really Hard" --Rating
wait(5)
for i =5,0, -1 do
wait(1)
msg.Text = "Time untill Game Starts: "..i
end
msg.Text = "GO!"
wait(1)
Players = game.Players:GetPlayers()
for i = 1, #Players do
if Players[i] ~= nil then
l = Workspace.BalanceTest.Tele -- The Start
Players[i].Character:MoveTo(l.Position)
msg.Text = ""
end end end
wait(10)
winners = { }


msg.Text = "The Minigame has ended"
wait(2)
for i = 1, #Players do
if Players[i]:FindFirstChild("Winner") ~= nil then
if Players[i].Winner.Value == 1 then
table.insert(winners, Players[i].Name)
Players[i].leaderstats["Total Points"].Value = Players[i].leaderstats["Total Points"].Value + 1 -- The Amount you win
Players[i].leaderstats["Sever Points"].Value = Players[i].leaderstats["Sever Points"].Value + 1
end end end

wincount = 0
for fgh = 1, #winners do
wincount = wincount +1
end
if wincount >1 then
msg.Text = table.concat(winners, ", ").." Have Won, they each recive a Point"
elseif wincount == 1 then
msg.Text = table.concat(winners, "").." Has Won, and recives a Point"
elseif wincount == 0 then
msg.Text = "Nobody has won"
end
wincount = 0
winners = { }
msg:remove()
Players = game.Players:GetChildren()
for i = 1, #Players do
if Players[i] ~= nil then
if Players[i].Character ~= nil then
Players[i].Character:MoveTo(game.Workspace.LobbyTele.Position)
end end end
for i = 1, #Players do
if Players[i] ~= nil then
if Players[i]:FindFirstChild("Winner") ~= nil then
Players[i].Winner.Value = 0
end end end end

Report Abuse
Alex645ca is not online. Alex645ca
Joined: 02 Feb 2009
Total Posts: 2531
09 Aug 2011 09:55 AM
... Last I checked Players doesn't have a GetPlayers() method. >_>

"Players = game.Players:GetPlayers()" ...
Report Abuse
bikerking300 is not online. bikerking300
Joined: 31 Mar 2010
Total Posts: 1034
09 Aug 2011 09:56 AM
Oh didnt see that..
Report Abuse
bikerking300 is not online. bikerking300
Joined: 31 Mar 2010
Total Posts: 1034
09 Aug 2011 09:58 AM
while wait(5) do
local m = math.random(1,1)
msg = Instance.new("Message",Workspace) -- If i put it like this ("Message",Workspace --Thats the parent of the msg.)
hnt = Instance.new("Hint",Workspace)
msg.Parent = nil
hnt.Parent = nil
if m == 1 then
for i = 10,0, -1 do
wait(1)
hnt.Text = "Time untill Next Game: "..i
end -- ends the for loop.
msg.Text = "Choosing Boot Camp Minigame." --A bunch of messages to tell you that the game is starting which you can change if desired
wait(3)
msg.Text = "A Boot Camp Minigame has been chosen!"
wait(3)
msg.Text = "The Boot Camp Minigame is..."
wait(3)
msg.Text = "Balance Test"
wait(4)
msg.Text = "Get Across The Balance Course Before the Time Runs Out! Don't fall! You have 3 Minutes" --Instructions
wait(5)
msg.Text = "Difficulty Rating: Really Hard" --Rating
wait(5)
for i =5,0, -1 do
wait(1)
msg.Text = "Time untill Game Starts: "..i
end
msg.Text = "GO!"
wait(1)
Players = game.Players:GetChildren()
for i = 1, #Players do
if Players[i] ~= nil then
l = Workspace.BalanceTest.Tele -- The Start
Players[i].Character:MoveTo(l.Position)
msg.Text = ""
end end end
wait(10)
winners = { }


msg.Text = "The Minigame has ended"
wait(2)
for i = 1, #Players do
if Players[i]:FindFirstChild("Winner") ~= nil then
if Players[i].Winner.Value == 1 then
table.insert(winners, Players[i].Name)
Players[i].leaderstats["Total Points"].Value = Players[i].leaderstats["Total Points"].Value + 1 -- The Amount you win
Players[i].leaderstats["Sever Points"].Value = Players[i].leaderstats["Sever Points"].Value + 1
end end end

wincount = 0
for fgh = 1, #winners do
wincount = wincount +1
end
if wincount >1 then
msg.Text = table.concat(winners, ", ").." Have Won, they each recive a Point"
elseif wincount == 1 then
msg.Text = table.concat(winners, "").." Has Won, and recives a Point"
elseif wincount == 0 then
msg.Text = "Nobody has won"
end
wincount = 0
winners = { }
msg:remove()
Players = game.Players:GetChildren()
for i = 1, #Players do
if Players[i] ~= nil then
if Players[i].Character ~= nil then
Players[i].Character:MoveTo(game.Workspace.LobbyTele.Position)
end end end
for i = 1, #Players do
if Players[i] ~= nil then
if Players[i]:FindFirstChild("Winner") ~= nil then
Players[i].Winner.Value = 0
end end end end
Report Abuse
TheJKid is not online. TheJKid
Joined: 22 Oct 2009
Total Posts: 5202
09 Aug 2011 09:58 AM
It works

Alex645ca

Report Abuse
bikerking300 is not online. bikerking300
Joined: 31 Mar 2010
Total Posts: 1034
09 Aug 2011 10:04 AM
:o no credit to me D:
Report Abuse
TheJKid is not online. TheJKid
Joined: 22 Oct 2009
Total Posts: 5202
09 Aug 2011 10:06 AM
It was just I needed to add a wait(5) simples.
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