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: Can U find the bug in the script

Previous Thread :: Next Thread 
dumbturtle is not online. dumbturtle
Joined: 06 Dec 2010
Total Posts: 247
07 Mar 2012 03:15 PM
----------------------------------------[[SETTINGS]]----------------------------------------
--[[]] money1 = 150 --
--[[]] money2 = 100 --
--------------------------------------------------------------------------------------------

h = Instance.new("Hint")
h.Parent = game.Workspace
h.Text = ""

RegTeam = Instance.new("Team")
RegTeam.Name = "Players"
RegTeam.TeamColor = BrickColor.new("Medium stone grey")
RegTeam.Parent = game:GetService("Teams")

function round()
cc = 0
c = game.Players:GetChildren()
for num, obj in pairs(c) do
if obj:FindFirstChild("Playing") then
if obj.Playing.Value then
cc = cc + 1
end
end
end
while cc < 2 do
cc = 0
c = game.Players:GetChildren()
for num, obj in pairs(c) do
if obj:FindFirstChild("Playing") then
if obj.Playing.Value then
cc = cc + 1
end
end
end
h.Text = "Atleast 2 players needed to play."
wait(1)
end
h.Text = "New Tournament Is Starting"
wait(3)
h.Text = "Choosing Map......."
wait(5)
m = game.Lighting.Minigames:GetChildren()
mg = m[math.random(1,#m)]
map = mg.Map
map.Parent = game.Workspace
h.Text = ("Map Found It's"..mg.Name)
wait(3)
h.Text = "Teleporting players and giving tools..."
wait(3)
c = game.Players:GetChildren()
balanced = true
red = 0
blue = 0
if mg.Mode.Value == 3 then
rt = Instance.new("Team")
rt.Parent = game:GetService("Teams")
rt.AutoAssignable = false
rt.TeamColor = BrickColor.new("Bright red")
rt.Name = "Red team"
bt = Instance.new("Team")
bt.Parent = game:GetService("Teams")
bt.AutoAssignable = false
bt.TeamColor = BrickColor.new("Bright blue")
bt.Name = "Blue team"
end
for num, obj in pairs(c) do
if obj then
if obj.Playing.Value and obj.Character:FindFirstChild("Torso") then
if mg.Mode.Value == 3 then
for numm, objj in pairs(mg.Tools:GetChildren()) do
objj:clone().Parent = obj.Backpack
wait()
end
cc = map:GetChildren()
if balanced then
team = math.random(1,2)
if team == 1 then
red = red + 1
obj.TeamColor = BrickColor.new("Bright red")
elseif team == 2 then
blue = blue + 1
obj.TeamColor = BrickColor.new("Bright blue")
end
teles = {}
for nuum, obbj in pairs(cc) do
if team == 1 then
if obbj.Name == "RedTele" then
table.insert (teles, obbj)
end
elseif team == 2 then
if obbj.Name == "BlueTele" then
table.insert (teles, obbj)
end
end
wait()
end
tele = teles[math.random(1,#teles)]
x1 = tele.Position.X-(tele.Size.X/2)
x2 = tele.Position.X+(tele.Size.X/2)
z1 = tele.Position.Z-(tele.Size.Z/2)
z2 = tele.Position.Z+(tele.Size.Z/2)
obj.Character.Torso.CFrame = CFrame.new(math.random(x1,x2),tele.Position.Y+5,math.random(z1,z2))
balanced = false
else
if red < blue then
team = 1
else
team = 2
end
if team == 1 then
red = red + 1
obj.TeamColor = BrickColor.new("Bright red")
elseif team == 2 then
blue = blue + 1
obj.TeamColor = BrickColor.new("Bright blue")
end
teles = {}
for nuum, obbj in pairs(cc) do
if team == 1 then
if obbj.Name == "RedTele" then
table.insert (teles, obbj)
end
elseif team == 2 then
if obbj.Name == "BlueTele" then
table.insert (teles, obbj)
end
end
wait()
end
tele = teles[math.random(1,#teles)]
x1 = tele.Position.X-(tele.Size.X/2)
x2 = tele.Position.X+(tele.Size.X/2)
z1 = tele.Position.Z-(tele.Size.Z/2)
z2 = tele.Position.Z+(tele.Size.Z/2)
obj.Character.Torso.CFrame = CFrame.new(math.random(x1,x2),tele.Position.Y+5,math.random(z1,z2))
balanced = true
end
obj.Character.Humanoid.WalkSpeed = 0
obj.PlayerGui.Play.Alive.Value = true
wait()
else
for numm, objj in pairs(mg.Tools:GetChildren()) do
objj:clone().Parent = obj.Backpack
wait()
end
cc = map:GetChildren()
teles = {}
for nuum, obbj in pairs(cc) do
if obbj.Name == "Tele" then
table.insert (teles, obbj)
end
wait()
end
tele = teles[math.random(1,#teles)]
x1 = tele.Position.X-(tele.Size.X/2)
x2 = tele.Position.X+(tele.Size.X/2)
z1 = tele.Position.Z-(tele.Size.Z/2)
z2 = tele.Position.Z+(tele.Size.Z/2)
obj.Character.Torso.CFrame = CFrame.new(math.random(x1,x2),tele.Position.Y+5,math.random(z1,z2))
obj.Character.Humanoid.WalkSpeed = 0
obj.PlayerGui.Play.Alive.Value = true
wait()
end
end
end
end
h.Text = ("Rules: "..mg.Rules.Value)
wait(5)
h.Text = "Ready.."
wait(1)
h.Text = "Set.."
wait(1)
h.Text = "GO!"
c = game.Players:GetChildren()
for num, obj in pairs(c) do
if obj.PlayerGui.Play.Alive.Value == true then
obj.Character.Humanoid.WalkSpeed = 16
end
wait()
end
wait(1)
if mg.Mode.Value == 1 then
count = 1
repeat
count = count + 1
c = game.Players:GetChildren()
count2 = {}
for num, obj in pairs(c) do
if obj.PlayerGui.Play.Alive.Value then
table.insert (count2,obj)
end
wait()
end
h.Text = ("Time left: "..mg.Time.Value-count)
wait(1)
until count >= mg.Time.Value or #count2 <= 1
if #count2 > 1 then
for num, obj in pairs(count2) do
ccc = obj.Backpack:GetChildren()
for a, b in pairs(ccc) do
b:remove()
wait()
end
ccc = obj.Character:GetChildren()
for a, b in pairs(ccc) do
if b.className == "Tool" then
b:remove()
elseif b.className == "HooperBin" then
b:remove()
end
wait()
end
if obj.Character:FindFirstChild("Torso") then
obj.Character.Torso.CFrame = game.Workspace.Lobby.LobbyPlatform.CFrame + Vector3.new(0,5,0)
end
wait()
end
h.Text = "Multiple players won."
wait(2)
stringz = {}
for num, obj in pairs(count2) do
table.insert (stringz, obj.Name)
wait()
end
h.Text = ("And they are: "..table.concat (stringz,", "))
wait(3)
h.Text = ("Each of them will get "..money2.." points!")
wait(3)
for num, obj in pairs(count2) do
obj.leaderstats.Points.Value = obj.leaderstats.Points.Value + money2
obj.PlayerGui.Play.Alive.Value = false
wait()
end
elseif #count2 == 1 then
ccc = count2[1].Backpack:GetChildren()
for a, b in pairs(ccc) do
b:remove()
wait()
end
ccc = count2[1].Character:GetChildren()
for a, b in pairs(ccc) do
if b.className == "Tool" then
b:remove()
elseif b.className == "HooperBin" then
b:remove()
end
wait()
end
if count2[1].Character:FindFirstChild("Torso") then
count2[1].Character.Torso.CFrame = game.Workspace.Lobby.LobbyPlatform.CFrame + Vector3.new(0,5,0)
end
h.Text = ("The winner was "..count2[1].Name.."!")
wait(3)
h.Text = ("And he will be awarded with "..money1.." points!")
wait(3)
count2[1].leaderstats.Points.Value = count2[1].leaderstats.Points.Value + money1
count2[1].PlayerGui.Play.Alive.Value = false
elseif #count2 == 0 then
h.Text = "In this round no one won. I hope you will have better luck next time."
end
elseif mg.Mode.Value == 2 then
count = 0
won = nil
map.FinishLine.Touched:connect(function(t)
if game.Players:FindFirstChild(t.Parent.Name) then
won = game.Players[t.Parent.Name]
end
end)
repeat
count = count + 1

h.Text = ("Time left: "..mg.Time.Value-count)
wait(1)
until count >= mg.Time.Value or won ~= nil

if won ~= nil then
for num, obj in pairs(game.Players:GetChildren()) do
if obj then
if obj.PlayerGui.Play.Alive.Value then
ccc = obj.Backpack:GetChildren()
for a, b in pairs(ccc) do
b:remove()
wait()
end
ccc = obj.Character:GetChildren()
for a, b in pairs(ccc) do
if b.className == "Tool" then
b:remove()
elseif b.className == "HooperBin" then
b:remove()
end
wait()
end
end
end
if obj.Character:FindFirstChild("Torso") then
obj.Character.Torso.CFrame = game.Workspace.Lobby.LobbyPlatform.CFrame + Vector3.new(0,5,0)
end
wait()
end
h.Text = ("The winner was "..won.Name.."!")
wait(3)
h.Text = ("And he will get awarded with "..money1.." points!")
wait(3)
won.leaderstats.Points.Value = won.leaderstats.Points.Value + money1
won.PlayerGui.Play.Alive.Value = false
else
h.Text = "In this round no one won. I hope you will have better luck next time."
end
elseif mg.Mode.Value == 3 then
count = 1
repeat
count = count + 1
c = game.Players:GetChildren()
count2 = {}
count3 = {}
for num, obj in pairs(c) do
if obj then
if obj.PlayerGui.Play.Alive.Value then
if obj.TeamColor == BrickColor.new("Bright red") then
table.insert (count2,obj)
elseif obj.TeamColor == BrickColor.new("Bright blue") then
table.insert (count3, obj)
end
end
end
wait()
end
h.Text = ("Time left: "..mg.Time.Value-count)
wait(1)
until count >= mg.Time.Value or #count2 <= 0 or #count3 <= 0
if #count2 == #count3 then
for num, obj in pairs(count2) do
ccc = obj.Backpack:GetChildren()
for a, b in pairs(ccc) do
b:remove()
wait()
end
ccc = obj.Character:GetChildren()
for a, b in pairs(ccc) do
if b.className == "Tool" then
b:remove()
elseif b.className == "HooperBin" then
b:remove()
end
wait()
end
if obj.Character:FindFirstChild("Torso") then
obj.Character.Torso.CFrame = game.Workspace.Lobby.LobbyPlatform.CFrame + Vector3.new(0,5,0)
end
wait()
end
for num, obj in pairs(count3) do
ccc = obj.Backpack:GetChildren()
for a, b in pairs(ccc) do
b:remove()
wait()
end
ccc = obj.Character:GetChildren()
for a, b in pairs(ccc) do
if b.className == "Tool" then
b:remove()
elseif b.className == "HooperBin" then
b:remove()
end
wait()
end
if obj.Character:FindFirstChild("Torso") then
obj.Character.Torso.CFrame = game.Workspace.Lobby.LobbyPlatform.CFrame + Vector3.new(0,5,0)
end
wait()
end
h.Text = "There was tie."
wait(2)
stringz = {}
for num, obj in pairs(count2) do
table.insert (stringz, obj.Name)
wait()
end
wait(3)
h.Text = ("Each player will get "..money2.." points!")
wait(3)
for num, obj in pairs(count2) do
obj.leaderstats.Points.Value = obj.leaderstats.Points.Value + money2
obj.PlayerGui.Play.Alive.Value = false
wait()
end
for num, obj in pairs(count3) do
obj.leaderstats.Points.Value = obj.leaderstats.Points.Value + money2
obj.PlayerGui.Play.Alive.Value = false
wait()
end
elseif #count2 > #count3 and #count3 > 0 then
for num, obj in pairs(count2) do
if obj then
ccc = obj.Backpack:GetChildren()
for a, b in pairs(ccc) do
b:remove()
wait()
end
ccc = obj.Character:GetChildren()
for a, b in pairs(ccc) do
if b.className == "Tool" then
b:remove()
elseif b.className == "HooperBin" then
b:remove()
end
wait()
end
if obj.Character:FindFirstChild("Torso") then
obj.Character.Torso.CFrame = game.Workspace.Lobby.LobbyPlatform.CFrame + Vector3.new(0,5,0)
end
wait()
end
for num, obj in pairs(count3) do
ccc = obj.Backpack:GetChildren()
for a, b in pairs(ccc) do
b:remove()
wait()
end
ccc = obj.Character:GetChildren()
for a, b in pairs(ccc) do
if b.className == "Tool" then
b:remove()
elseif b.className == "HooperBin" then
b:remove()
end
wait()
end
if obj.Character:FindFirstChild("Torso") then
obj.Character.Torso.CFrame = game.Workspace.Lobby.LobbyPlatform.CFrame + Vector3.new(0,5,0)
end
end
wait()
end
h.Text = ("The winner was red team!")
wait(3)
h.Text = ("They will get awarded with "..money1.." points, but as some of enemies are still alive, theyr team will get "..money2.." points!")
wait(3)
wait(3)
for num, obj in pairs(count2) do
obj.leaderstats.Points.Value = obj.leaderstats.Points.Value + money1
obj.PlayerGui.Play.Alive.Value = false
wait()
end
for num, obj in pairs(count3) do
obj.leaderstats.Points.Value = obj.leaderstats.Points.Value + money2
obj.PlayerGui.Play.Alive.Value = false
wait()
end
elseif #count2 < #count3 and #count2 > 0 then
for num, obj in pairs(count2) do
ccc = obj.Backpack:GetChildren()
for a, b in pairs(ccc) do
b:remove()
wait()
end
ccc = obj.Character:GetChildren()
for a, b in pairs(ccc) do
if b.className == "Tool" then
b:remove()
elseif b.className == "HooperBin" then
b:remove()
end
wait()
end
if obj.Character:FindFirstChild("Torso") then
obj.Character.Torso.CFrame = game.Workspace.Lobby.LobbyPlatform.CFrame + Vector3.new(0,5,0)
end
wait()
end
for num, obj in pairs(count3) do
ccc = obj.Backpack:GetChildren()
for a, b in pairs(ccc) do
b:remove()
wait()
end
ccc = obj.Character:GetChildren()
for a, b in pairs(ccc) do
if b.className == "Tool" then
b:remove()
elseif b.className == "HooperBin" then
b:remove()
end
wait()
end
if obj.Character:FindFirstChild("Torso") then
obj.Character.Torso.CFrame = game.Workspace.Lobby.LobbyPlatform.CFrame + Vector3.new(0,5,0)
end
wait()
end
h.Text = ("The winner was blue team!")
wait(3)
h.Text = ("They will get awarded with "..money1.." points, but as some of enemies are still alive, theyr team will get "..money2.." points!")
wait(3)
for num, obj in pairs(count2) do
obj.leaderstats.Points.Value = obj.leaderstats.Points.Value + money2
obj.PlayerGui.Play.Alive.Value = false
wait()
end
for num, obj in pairs(count3) do
obj.leaderstats.Points.Value = obj.leaderstats.Points.Value + money1
obj.PlayerGui.Play.Alive.Value = false
wait()
end
elseif #count2 == 0 then
for num, obj in pairs(count3) do
ccc = obj.Backpack:GetChildren()
for a, b in pairs(ccc) do
b:remove()
wait()
end
ccc = obj.Character:GetChildren()
for a, b in pairs(ccc) do
if b.className == "Tool" then
b:remove()
elseif b.className == "HooperBin" then
b:remove()
end
wait()
end
if obj.Character:FindFirstChild("Torso") then
obj.Character.Torso.CFrame = game.Workspace.Lobby.LobbyPlatform.CFrame + Vector3.new(0,5,0)
end
wait()
end
h.Text = ("The winner was blue team!")
wait(3)
h.Text = ("They will get awarded with "..money1.." points!")
wait(3)
for num, obj in pairs(count3) do
obj.leaderstats.Points.Value = obj.leaderstats.Points.Value + money1
obj.PlayerGui.Play.Alive.Value = false
wait()
end
elseif #count3 == 0 then
for num, obj in pairs(count2) do
ccc = obj.Backpack:GetChildren()
for a, b in pairs(ccc) do
b:remove()
wait()
end
ccc = obj.Character:GetChildren()
for a, b in pairs(ccc) do
if b.className == "Tool" then
b:remove()
elseif b.className == "HooperBin" then
b:remove()
end
wait()
end
if obj.Character:FindFirstChild("Torso") then
obj.Character.Torso.CFrame = game.Workspace.Lobby.LobbyPlatform.CFrame + Vector3.new(0,5,0)
end
wait()
end
h.Text = ("The winner was red team!")
wait(3)
h.Text = ("They will get awarded with "..money1.." points!")
wait(3)
for num, obj in pairs(count2) do
obj.leaderstats.Points.Value = obj.leaderstats.Points.Value + money1
obj.PlayerGui.Play.Alive.Value = false
wait()
end
elseif #count2 == 0 then
h.Text = "In this round no one won. I hope you will have better luck next time."
end
loldunno = game.Players:GetChildren()
for olol, trolol in pairs(loldunno) do
trolol.TeamColor = BrickColor.new("Medium stone grey")
wait()
end
rt:remove()
bt:remove()
end
map.Parent = mg
round()
end

round()
Report Abuse
Javeman2000 is not online. Javeman2000
Joined: 03 Sep 2008
Total Posts: 3027
07 Mar 2012 03:16 PM
wtf am I looking at? why don't you see for your-self and output it?
Report Abuse
dumbturtle is not online. dumbturtle
Joined: 06 Dec 2010
Total Posts: 247
07 Mar 2012 03:16 PM
The problem is that when 2 players are there and ready to play it sais selecting map and then doesnt get any farther. Any Help
Report Abuse
WhoBloxedWho is not online. WhoBloxedWho
Joined: 25 Mar 2009
Total Posts: 4611
07 Mar 2012 03:17 PM
Gimmie that output, and tell me where it is in tha wall of text...
Report Abuse
dumbturtle is not online. dumbturtle
Joined: 06 Dec 2010
Total Posts: 247
07 Mar 2012 03:18 PM
wat do u mean
Report Abuse
dumbturtle is not online. dumbturtle
Joined: 06 Dec 2010
Total Posts: 247
07 Mar 2012 03:19 PM
U can check by going 2 my place
Report Abuse
Javeman2000 is not online. Javeman2000
Joined: 03 Sep 2008
Total Posts: 3027
07 Mar 2012 03:22 PM
R U in Build mode or studio?
Report Abuse
dumbturtle is not online. dumbturtle
Joined: 06 Dec 2010
Total Posts: 247
07 Mar 2012 03:23 PM
STUDIO
Report Abuse
WhoBloxedWho is not online. WhoBloxedWho
Joined: 25 Mar 2009
Total Posts: 4611
07 Mar 2012 03:29 PM
Open the output, run the script, and tell us the red message that comes up.
Report Abuse
dumbturtle is not online. dumbturtle
Joined: 06 Dec 2010
Total Posts: 247
07 Mar 2012 03:32 PM
Workspace.Lobby.Sword Shop (Points).Swords.Buy Spiked Club- 1000.Head.PresentSc:57: '=' expected near 'club'
Report Abuse
dumbturtle is not online. dumbturtle
Joined: 06 Dec 2010
Total Posts: 247
09 Mar 2012 05:07 PM
anyone else?
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
09 Mar 2012 05:09 PM
Point out line 57.

† KMXD †
Report Abuse
dumbturtle is not online. dumbturtle
Joined: 06 Dec 2010
Total Posts: 247
09 Mar 2012 06:47 PM
kk
Report Abuse
dumbturtle is not online. dumbturtle
Joined: 06 Dec 2010
Total Posts: 247
09 Mar 2012 06:55 PM
57th line

rt.AutoAssignable = false
Report Abuse
XNoBoomX is not online. XNoBoomX
Joined: 08 May 2011
Total Posts: 4731
09 Mar 2012 06:59 PM
I hate to assume this, but you don't seem to familiar with this script and it seems familiar to me. Is this by any chance a free model you're trying to work in your place?

~{An Intellectual In Love With Bacon}~
Report Abuse
dumbturtle is not online. dumbturtle
Joined: 06 Dec 2010
Total Posts: 247
09 Mar 2012 07:03 PM
Half and Half i edited it but now i can't work out one last bug.
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