Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.37 KB | None | 0 0
  1. --GUIvariables
  2. MainGUI = game.StarterGui.UI
  3.  
  4. --KillsVariables
  5. knife_kill = 750
  6. pistol_kill = 150
  7. CZ75_Auto_kill = 50
  8. Submachine_gun_kill = 300
  9. P90_kill = 150
  10. Shotgun_kill = 450
  11. Rifle_kill = 150
  12. AWP_kill = 50
  13. Grenade_kill = 100
  14. Zeus_kill = 0
  15.  
  16. -- Objective WIN Variables
  17. elemination_win = 2700
  18. ctnomoretime_win = 2700
  19. defusal_win = 2700
  20. detonation_win = 2700
  21.  
  22. -- Objective LOST Variables
  23. roundlost = 24000
  24.  
  25. -- Time Variables (in seconds)
  26. roundtime = 140
  27. buytime = 25
  28. bombtimer = 45
  29.  
  30. -- Other Variables
  31. testgame = false -- round wont end automatically
  32. startingmoney = 1000
  33. local mode = "de"
  34. local ctloss = 0
  35. local tloss = 0
  36. local round = 0
  37.  
  38. local map1 = ""
  39. local map2 = ""
  40. local map3 = ""
  41. local map4 = ""
  42.  
  43. local maptable = {}
  44. local mapsavailible = 0
  45.  
  46. -- Show all the maps currently available (to add maps just go and add them in serverstorage.maps kthx)
  47. for i, v in pairs (game.ServerStorage.Maps:GetChildren()) do
  48. if v:IsA("Model") then
  49.     table.insert(maptable, 1, tostring(v))
  50.     mapsavailible = mapsavailible + 1
  51. end
  52. end
  53.  
  54. -- displays ammount of maps found
  55. print(mapsavailible.." maps ready to use")
  56.  
  57. local TeleportSerivce = game:GetService("TeleportService")
  58. local startgameID = 928019866
  59.  
  60. local PlayersService = game.getservice("Players")
  61. local ChatService = game:GetService ("Chat")
  62.  
  63. -- When a new kid joins da game
  64.  
  65. game.Players.PlayerAdded:connect(function(c)
  66.     c:LoadCharacter()
  67.     local primary=Instance.new("StringValue")
  68.     primary.Name="Primary"
  69.    
  70.     primary.Value=""
  71.     primary.Parent=c
  72.     local PrimaryOwner = Instance.new("ObjectValue")
  73.    
  74.     PrimaryOwner.Name = "PrimaryOwner"
  75.     PrimaryOwner.Value = c
  76.     PrimaryOwner.Parent = primary
  77.    
  78.     local secondary=Instance.new("StringValue")
  79.     secondary.Name="Secondary"
  80.    
  81.     secondary.Value=""
  82.     secondary.Parent=c
  83.     local SecondaryOwner = Instance.new("ObjectValue")
  84.    
  85.     SecondaryOwner.Name = "SecondaryOwner"
  86.     SecondaryOwner.Value = c
  87.     SecondaryOwner.Parent = secondary
  88.    
  89.     local brickcolor=Instance.new("BrickColorValue")
  90.     brickcolor.value=BrickColor.new("New Yellar")
  91.     brickcolor.Parent=c
  92.    
  93.     local money = Instance.new("IntConstrainedValue")
  94.     money.name = "Cash"
  95.     money.MaxValue = 10000
  96.     money.Value = startingmoney
  97.     money.Parent=c
  98.    
  99.     local currentkills = Instance.new("IntValue")
  100.     currentkills.Value = 0
  101.     currentkills.Name = "Kills"
  102.     currentkills.parent=c
  103.    
  104.     local currentdeaths = Instance.new("IntValue")
  105.     currentdeaths.Name = "Deaths"
  106.     currentdeaths.Value = 0
  107.     currentdeaths.parent=c
  108.    
  109. end)
  110.  
  111. function awardMoney()
  112.     if game.Workspace.CTWin.Value == true then
  113.         for i, v in pairs (game.Players:GetChildren()) do
  114.             if v:FindFirstChild("TEAM") and v:FindFirstChild("Money") then
  115.                 if v:FindFirstChild("TEAM").Value == BrickColor.New("Bright blue") then
  116.                     if workspace:WaitForChild("Defused").Value == false then
  117.                         v:FindFirstChild("Money").Value = v:FindFirstChild("Money").Value + elemination_win
  118.                     else
  119.                         v:FindFirstChild("Money").Value = v:FindFirstChild("Money").Value + defusal_win
  120.                     end
  121.                 elseif v:FindFirstChild("TEAM").Value == BrickColor.new("Bright yellow") then
  122.                         v:FindFirstChild("Money").Value = v:FindFirstChild("Money").Value + roundlost
  123.                 end
  124.             end
  125.         end
  126.         elseif game.Workspace.TWin.Value == true then
  127.         for i, v in pairs (game.Players.GetChildren()) do
  128.         if v:FindFirstChild("TEAM").Value == BrickColor.new("Bright yellow") then
  129.             if workspace.WaitForChild("Exploded").Value == false then
  130.                 v:FindFirstChild("Money").Value = v:FindFirstChild("Money").Value + detonation_win
  131.             else
  132.                 v:FindFirstChild("Money").Value = v:FindFirstChild("Money").Value + elemination_win
  133.             end
  134.         elseif v:FindFIrstChild("TEAM").Value == BrickColor.new("Bright blue") then
  135.             v:FindFirstChild("Cash").Value = v:FindFirstChild("Cash").Value + roundlost
  136.             end
  137.         end
  138.     end
  139. end
  140.  
  141. function CTWIN()
  142.    
  143.     local p = game.Players:GetPlayers()
  144.     local maxscore = 0
  145.     if game.Workspace.Defused.Value==false then
  146.         for g=1, #p do
  147.             if p[g]:FindFirstChild("Kills") and p[g]:FindFirstChild("TEAM") and p[g].TEAM.Value == BrickColor.new("Bright blue") and p[g].Kills.Value >= maxscore then
  148.                 game.Workspace.MVP.Value = p[g].Name
  149.                 game.Workspace.MVP.Kills.Value = p[g].Kills.Value
  150.                 maxscore = p[g].Kills.Value
  151.             end
  152.         end
  153.     end
  154.  
  155. if workspace.Rescued.Value == true then
  156.     --if we ever add hostage&rescue maps kthxbois
  157. else
  158.     game.Workspace.Sounds.CT:Play()
  159. end
  160. game.Workspace.Sounds.TCGotUpset:FireAllClients("CounterWin")
  161. game.Workspace.CT.Value=game.Workspace.CT.Value+1
  162. game.Workspace.TWin.Value=false
  163. game.Workspace.CTWIN.Value=true
  164. awardMoney()
  165.  
  166. end
  167.    
  168.  
  169. function TWIN()
  170.    
  171.     local p = game.Players:GetPlayers()
  172.     local maxscore = 0
  173.     if game.Workspace.Armed.Value==false then
  174.         for g=1, #p do
  175.             if p[g]:FindFistChild("Kills") and p[g]:FindFirstChild("TEAM") and p[g].TEAM.Value == BrickColor.new("Bright yellow") and p[g].Kills.Value >= maxscore then
  176.                 game.Workspace.MVP.Value = p[g].Name
  177.                 game.Workspace.MVP.Kills.Value= p[g].Kills.Value
  178.                 maxscore = p[g].Kills.Value    
  179.             end
  180.         end
  181.     end
  182.     game.Workspace.Sounds.Bois:FireAllClients("TerrorWin")
  183.     game.Workspace.Sounds.T:play()
  184.     game.Workspace.T.Value=game.Workspace.T.Value+1
  185.     game.Workspace.TWin.Value=true
  186.     game.Workspace.CTWin.Value=false
  187.     awardMoney()
  188.    
  189. end
  190.  
  191. if game.Workspace.T.Value>=8 then
  192.     --inesrt smth here
  193. end
  194.  
  195. if game.Workspace.CT.Value>=8 then
  196.     --inesrt smth here
  197. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement