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 » Scripters
Home Search
 

Broken Script

Previous Thread :: Next Thread 
colinrules10 is not online. colinrules10
Joined: 04 May 2013
Total Posts: 878
26 Oct 2015 04:29 PM
I need help with editing a script that determines which team wins the game. Here it is:

function countBricks(model, color1, color2)
local color1count = 0
local color2count = 0

for index, child in pairs(model:GetChildren()) do
if child:IsA('BasePart') then -- Check if child can have color.
if child.BrickColor == color1 then
color1count = color1count + 1
elseif child.BrickColor == color2 then
color2count = color2count + 2
end
end
end

return color1count, color2count
end

wait(2)
script.canister:Play()
wait(3)
script.canister:Stop()
c1 = BrickColor.new("Cyan")
c2 = BrickColor.new("Pink")
c1num, c2num = countBricks(workspace, c1, c2)
if c1num > c2num then
game.Workspace.eventboard.gui.Text.Text = "Blue Wins!"
v.PlayerGui.ScreenGui.TextLabel.Text = "Blue Wins!"
for _,v in pairs(game.Players:GetPlayers()) do
if v.TeamColor == "Cyan" then -- assuming winningTeam is a BrickColor value
script.victory:Play()
wait(4)
script.victory:Stop()
elseif v.TeamColor == "Pink" then
script.defeat:Play()
wait(6)
script.defeat:Stop()
end
end
elseif c2num == c1num then
else
v.PlayerGui.ScreenGui.TextLabel.Text = "Pink Wins!" ----Here is what I need help with, and below
game.Workspace.eventboard.gui.Text.Text = "Pink Wins!"
for _,v in pairs(game.Players:GetPlayers()) do
if v.TeamColor == "Pink" then
script.victory:Play()
wait(4)
script.victory:Stop()
elseif v.TeamColor == "Cyan" then
script.defeat:Play()
script.defeat.TimePosition = 6
wait(6)
script.defeat:Stop()
end
end

_______________________________________________________________________



So anyways it counts up the bricks and then the team that painted the most bricks heres the victory audio, and the losing team heres the losing audio. For some reason the audios aren't playing :( Can anyone fix this?
Report Abuse
colinrules10 is not online. colinrules10
Joined: 04 May 2013
Total Posts: 878
26 Oct 2015 04:44 PM
Bump
Report Abuse
robotmega is not online. robotmega
Joined: 16 May 2009
Total Posts: 14084
26 Oct 2015 04:45 PM
Add More End"(S)
Report Abuse
colinrules10 is not online. colinrules10
Joined: 04 May 2013
Total Posts: 878
26 Oct 2015 04:46 PM
*adds end*

*error appears*
Report Abuse
colinrules10 is not online. colinrules10
Joined: 04 May 2013
Total Posts: 878
26 Oct 2015 04:49 PM
Buuump
Report Abuse
colinrules10 is not online. colinrules10
Joined: 04 May 2013
Total Posts: 878
26 Oct 2015 05:00 PM
Anyone?
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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