gleebza1
|
  |
| Joined: 08 Mar 2012 |
| Total Posts: 8762 |
|
|
| 19 Jan 2013 01:31 PM |
local game_length = 420 -- How long round is... DUH! (End the game, show a message, regen stuff, rebalance teams, cause MAJOR LAG ~~Keonesan~~ Please give me credit...
local red_stuff = game.Workspace.:clone() -- Put the name of the stuff you want to regen in these three lines. local blue_stuff = game.Workspace.:clone() local gold_killbot = game.Workspace.Map:clone()
message = nil function showMessage(text) -- This function flashes a message to all players -- Clears the message with hideMessage()
hideMessage() -- Makes sure only one message comes up at a time. if message == nil then message = Instance.new("Message") end -- Makes a message... (Kinda obvious) message.Text = text message.Parent = game.Workspace end
function hideMessage() if message == nil then return end message.Parent = nil end
function RegenGoldKillbot() -- Part two of regen stuff... game.Workspace.Map:remove() -- Insert name of stuff yet again local new_stuff = gold_killbot:clone() new_stuff.Parent = game.Workspace new_stuff:makeJoints() end
function RegenRed(Map) game.Workspace.RedFlagSet:remove() local new_stuff = red_stuff:clone() new_stuff.Parent = game.Workspace new_stuff:makeJoints() end
function RegenBlue() game.Workspace.BlueFlagSet:remove() local new_stuff = blue_stuff:clone() new_stuff.Parent = game.Workspace new_stuff:makeJoints() end
function clearPlayerInfo() --Now we get into the leaderboard stuff! =D -- Resets points... local players = game.Players:children() -- Gets all the players... for i = 1, #players do if (players[i]:findFirstChild("leaderstats") ~= nil) and (players[i].leaderstats.Captures ~= nil) then players[i].leaderstats.Captures.Value = 0 end -- Change Points to whatever your leaderboard counts if (players[i]:findFirstChild("leaderstats") ~= nil) and (players[i].leaderstats.Captures ~= nil) then players[i].leaderstats.Captures.Value = 0 end -- Same thing except it's named Spree end end
function getWinnerInfo() -- This is where it makes an annoying message to tell who won. -- This part gets a bit tricky.
-- This makes sure to count a tie if not the game will crash. local highscore = 0 local winner = "No one" local tie = false
local players = game.Players:children() -- Ounce again gets the players... for i = 1, #players do local pscore = -1 if players[i]:findFirstChild("leaderstats") ~= nil then if players[i].leaderstats.Points ~= nil then pscore = players[i].leaderstats.Captures.Value -- Points thing again. Remember to change. end end
if pscore == highscore then -- HIGHSCORE! tie = true end
if pscore > highscore then -- New highscore! highscore = pscore winner = players[i].Name tie = false end end if tie == true then return "Tie game!" end -- IT'S A TIE! D= local text = string.format("%s %s %d %s", winner, "wins with", highscore, "Captures!") -- Don't change anything except where it says Points. CHANGE THAT TO YOUR LEADERBOARD! return text end
function getWinningTeamString() -- WINNER! local red = 0 local blue = 0
local p = game.Players:children() for i=1,#p do if (p[i].TeamColor == game.Teams:findFirstChild("Blue Boys").TeamColor) then -- Put blue team name here.... if (p[i]:findFirstChild("leaderstats") ~= nil and p[i].leaderstats.Captures ~= nil) then blue = blue + p[i].leaderstats.Captures.Value end end
if (p[i].TeamColor == game.Teams:findFirstChild("Red Boys").TeamColor) then -- Now red team's name.... if (p[i]:findFirstChild("leaderstats") ~= nil and p[i].leaderstats.Captures ~= nil) then red = red + p[i].leaderstats.Captures.Value end end end
if (red == blue) then return "Teams Tie!" end -- Tie thing again don't mess with it.
if (red > blue) then return string.format("Red won the match by %d Captures!", red - blue) end -- Ounce again just change points.
return string.format("Blue won the match by %d Captures!", blue - red) -- You know what to do...
end
while true do -- This is reminder stuff... wait(game_length - 120) -- Oune there's one minute left it tells everyone basicly. You can change it if you want. showMessage("1 Minute Until End of the Game!") -- Message... wait(5) --- Waits five seconds. Probably don't want to change it... hideMessage() wait(55) -- Remaining time of round...
-- Puts up winning team info! showMessage(getWinningTeamString()) wait(10) RegenGoldKillbot() -- Regen stuff... RegenRed(Map) RegenBlue() showMessage("Rebalancing teams and launching new game...") -- Tells everyone that it's going to be a noob and take away your points and regen everything... O_O wait(5) clearPlayerInfo() -- Resets points... game.Teams:rebalanceTeams() -- Rebalances teams...
hideMessage() -- Nobody reads an entire script. This is a reminder that Keonesan made this script.
end |
|
|
| Report Abuse |
|
|
|
| 19 Jan 2013 01:32 PM |
Scripting Helpers please. Just because we're higher up, it doesn't mean it is right ot post here.
Plus you need to add more detail about the problem. |
|
|
| Report Abuse |
|
|
pwnedu46
|
  |
| Joined: 23 May 2009 |
| Total Posts: 7534 |
|
|
| 19 Jan 2013 01:32 PM |
| This isn't SH, and you'll never get a response without telling us what the problem is. |
|
|
| Report Abuse |
|
|
gleebza1
|
  |
| Joined: 08 Mar 2012 |
| Total Posts: 8762 |
|
|
| 19 Jan 2013 01:32 PM |
| I don't know the specific part that's wrong... |
|
|
| Report Abuse |
|
|
pwnedu46
|
  |
| Joined: 23 May 2009 |
| Total Posts: 7534 |
|
| |
|
gleebza1
|
  |
| Joined: 08 Mar 2012 |
| Total Posts: 8762 |
|
|
| 19 Jan 2013 01:33 PM |
| That's my problem@pwned I don't know what it is... |
|
|
| Report Abuse |
|
|
|
| 19 Jan 2013 01:33 PM |
| Well find out how you find out the specific problem. |
|
|
| Report Abuse |
|
|
gleebza1
|
  |
| Joined: 08 Mar 2012 |
| Total Posts: 8762 |
|
|
| 19 Jan 2013 01:35 PM |
It's a round script from my game. it's supposed to decide if you Won,Tie,or Lost. it's not doing that....:( the game won't even start. |
|
|
| Report Abuse |
|
|
pwnedu46
|
  |
| Joined: 23 May 2009 |
| Total Posts: 7534 |
|
|
| 19 Jan 2013 01:35 PM |
"That's my problem@pwned I don't know what it is..."
Then post on SH and tell them what is happening, what should be happening, and any relevant output. Tell them what you think the problem is. Only post relevant code, nobody is going to look through all of that. |
|
|
| Report Abuse |
|
|
| |
|
pwnedu46
|
  |
| Joined: 23 May 2009 |
| Total Posts: 7534 |
|
|
| 19 Jan 2013 01:36 PM |
| RAGE! LATETOASTED AGAIN! D: |
|
|
| Report Abuse |
|
|
gleebza1
|
  |
| Joined: 08 Mar 2012 |
| Total Posts: 8762 |
|
|
| 19 Jan 2013 01:36 PM |
"Scripters" You people aren't legit scripters?.... D= qq |
|
|
| Report Abuse |
|
|
pwnedu46
|
  |
| Joined: 23 May 2009 |
| Total Posts: 7534 |
|
|
| 19 Jan 2013 01:37 PM |
""Scripters" You people aren't legit scripters?.... D= qq"
We are SCRIPTERS, not Scripting HELPERS. |
|
|
| Report Abuse |
|
|
|
| 19 Jan 2013 01:38 PM |
This is a hangout forum for scripters. If you aren't a scripter, you shouldn't be here, basically.
There is a very useful tool in Studio called the Output. Find it and use it. |
|
|
| Report Abuse |
|
|
zars15
|
  |
| Joined: 10 Nov 2008 |
| Total Posts: 9999 |
|
|
| 19 Jan 2013 01:38 PM |
@glee. 'scripters' ~= 'scripting helpers'
|
|
|
| Report Abuse |
|
|
|
| 19 Jan 2013 01:38 PM |
| I'm the one with the toast this time... |
|
|
| Report Abuse |
|
|
pwnedu46
|
  |
| Joined: 23 May 2009 |
| Total Posts: 7534 |
|
| |
|
gleebza1
|
  |
| Joined: 08 Mar 2012 |
| Total Posts: 8762 |
|
|
| 19 Jan 2013 01:40 PM |
What's toast...? is it a metaphor or...actual toast? And I'm a scripter :D ....Somewhat, I do have problems from time-to-time though. |
|
|
| Report Abuse |
|
|
zars15
|
  |
| Joined: 10 Nov 2008 |
| Total Posts: 9999 |
|
| |
|
|
| 19 Jan 2013 01:41 PM |
Late toast/post
Pwnedu had quite a few toasts then I had one. |
|
|
| Report Abuse |
|
|
|
| 19 Jan 2013 01:41 PM |
CRAP
I toasted
-Floodcheck avoider- |
|
|
| Report Abuse |
|
|
gleebza1
|
  |
| Joined: 08 Mar 2012 |
| Total Posts: 8762 |
|
|
| 19 Jan 2013 01:43 PM |
....I don't understand. how do you Late post? someone says what you want to say before you? is that what I'm understanding...? e.e |
|
|
| Report Abuse |
|
|
| |
|
gleebza1
|
  |
| Joined: 08 Mar 2012 |
| Total Posts: 8762 |
|
| |
|
|
| 19 Jan 2013 01:46 PM |
| Not sure where the toast bit came from. |
|
|
| Report Abuse |
|
|