Advertisement
Guest User

Untitled

a guest
Jan 19th, 2020
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.26 KB | None | 0 0
  1. -- Made by Xerdai
  2.  
  3. -- Variables
  4. local debris = game:GetService("Debris")
  5. local players = game:GetService("Players")
  6. local communication = game:GetService("ReplicatedStorage"):WaitForChild("Communication")
  7. --local stadiumChange = game:GetService("ReplicatedStorage"):WaitForChild("StadiumDisplay")
  8. -- messages:
  9. -- editLimbs
  10. -- resetWelds
  11. -- resetLimb
  12. -- runAnimation
  13. -- fouledPlayer
  14. -- moveCheck
  15. -- throwCheck
  16. -- saveBall
  17. -- wantsHomeGK
  18. -- wantsAwayGK
  19. -- quitGK
  20.  
  21. -- local toolGui = game:GetService("ServerStorage"):WaitForChild("toolGUI")
  22.  
  23. -- Methods
  24. --[[function getGroupId(name)
  25. -- GetCollisionGroupId will throw if it does not exist
  26. local ok, groupId = pcall(ps.GetCollisionGroupId, ps, name)
  27. return ok and groupId or nil
  28. end]]--
  29.  
  30. -- events
  31.  
  32. game.Teams.T1.PlayerRemoved:Connect(function(player)
  33. if game.Teams.T1.Goalkeeper.Value == player then
  34. print("T1 Goalkeeper, ".. tostring(player.Name)..", has left the team, GK tool available")
  35. game.Teams.T1.Goalkeeper.Value = nil
  36. end
  37. end)
  38.  
  39. game.Teams.T2.PlayerRemoved:Connect(function(player)
  40. if game.Teams.T2.Goalkeeper.Value == player then
  41. print("T2 Goalkeeper, " .. tostring(player.Name) .. ", has left the team, GK tool available")
  42. game.Teams.T2.Goalkeeper.Value = nil
  43. end
  44. end)
  45.  
  46. -- Gameplay
  47.  
  48.  
  49. communication.OnServerEvent:Connect(function(plr, msg, arg1, arg2, arg3, arg4, arg5)
  50. local ticc = tick()
  51. --[[if msg == "focusArm" then
  52. print("communication focus arm")
  53. communication:FireAllClients("focusArmRelay", plr, arg1, arg2)
  54.  
  55. elseif msg == "focusTipArm" then
  56. print("communication focus tip arm")
  57. communication:FireAllClients("focusTipArmRelay", plr, arg1)
  58. elseif msg == "SpookySound" then
  59. print("communication spooky sound")
  60. SPOOKY_SONG = Instance.new("Sound")
  61. SPOOKY_SONG.Name = "SPOOKY"
  62. SPOOKY_SONG.Parent = plr.Character.Torso
  63. SPOOKY_SONG.SoundId = "rbxassetid://160442087"
  64. SPOOKY_SONG.MaxDistance = 140
  65. SPOOKY_SONG.Volume = 0
  66. SPOOKY_SONG.TimePosition = 0.3
  67. SPOOKY_SONG:Play()
  68. for i = 0, 1, 0.1 do
  69. wait(0.2)
  70. SPOOKY_SONG.Volume = i
  71. end
  72. SPOOKY_SONG.Volume = 1
  73. wait(12)
  74. for i = 1, 0, -0.1 do
  75. wait(0.2)
  76. SPOOKY_SONG.Volume = i
  77. end
  78. SPOOKY_SONG.Volume = 0
  79. SPOOKY_SONG:Destroy()
  80.  
  81. elseif msg == "KetsuWoTaberu" then
  82. print("communication ketsu wo teberu")
  83. wait(4)
  84. if plr and plr.Character then
  85. local c = plr.Character;
  86. c.Archivable = true;
  87. local clone1 = c:Clone();
  88. local clone2 = c:Clone();
  89. clone1.Parent = workspace
  90. clone2.Parent = workspace
  91. clone1.Name = ""
  92. clone2.Name = ""
  93. clone1["Head"].Transparency = 1
  94. clone1["Torso"].Transparency = 1
  95. clone1["Left Arm"].Transparency = 1
  96. clone1["Right Arm"].Transparency = 1
  97. clone1["Left Leg"].Transparency = 1
  98. clone1["Right Leg"].Transparency = 1
  99. clone2["Head"].Transparency = 1
  100. clone2["Torso"].Transparency = 1
  101. clone2["Left Arm"].Transparency = 1
  102. clone2["Right Arm"].Transparency = 1
  103. clone2["Left Leg"].Transparency = 1
  104. clone2["Right Leg"].Transparency = 1
  105. clone1:MoveTo(c.Torso.Position + c.Torso.CFrame.lookVector * 2.5 + c.Torso.CFrame.rightVector * 5)
  106. clone2:MoveTo(c.Torso.Position + c.Torso.CFrame.lookVector * 2.5 + c.Torso.CFrame.rightVector * -5)
  107. for i = 1, 0, -0.2 do
  108. wait(1/20)
  109. clone1["Head"].Transparency = i
  110. clone1["Torso"].Transparency = i
  111. clone1["Left Arm"].Transparency = i
  112. clone1["Right Arm"].Transparency = i
  113. clone1["Left Leg"].Transparency = i
  114. clone1["Right Leg"].Transparency = i
  115. clone2["Head"].Transparency = i
  116. clone2["Torso"].Transparency = i
  117. clone2["Left Arm"].Transparency = i
  118. clone2["Right Arm"].Transparency = i
  119. clone2["Left Leg"].Transparency = i
  120. clone2["Right Leg"].Transparency = i
  121. end
  122.  
  123. wait(1.9)
  124. for i = 0, 1, 0.2 do
  125. wait(1/20)
  126. clone1["Head"].Transparency = i
  127. clone1["Torso"].Transparency = i
  128. clone1["Left Arm"].Transparency = i
  129. clone1["Right Arm"].Transparency = i
  130. clone1["Left Leg"].Transparency = i
  131. clone1["Right Leg"].Transparency = i
  132. clone2["Head"].Transparency = i
  133. clone2["Torso"].Transparency = i
  134. clone2["Left Arm"].Transparency = i
  135. clone2["Right Arm"].Transparency = i
  136. clone2["Left Leg"].Transparency = i
  137. clone2["Right Leg"].Transparency = i
  138. end
  139. clone1:Destroy()
  140. clone2:Destroy()
  141. end
  142.  
  143. elseif msg == "SuperSaiyan" then
  144. print("communication super saiyan")
  145. wait(1)
  146. local Ball = Instance.new("Part")
  147. Ball.Shape = "Ball"
  148. Ball.CanCollide = false
  149. Ball.Color = Color3.new(0/255, 155/255, 255/255)
  150. Ball.Transparency = 0.75
  151. Ball.Anchored = true
  152. Ball.Material = Enum.Material.Neon
  153. Ball.Size = Vector3.new(1,1,1)
  154. Ball.Position = plr.Character.Torso.Position
  155. Ball.Parent = workspace
  156. local Hair4 = game.ServerStorage.SuperSaiyan:Clone()
  157. Hair4.Parent = plr.Character
  158. Hair4.Name = "Hair"
  159. Hair4.CanCollide = false
  160. Hair4.Locked = true
  161. Hair4.CFrame = plr.Character.Torso.CFrame
  162. local Weld = Instance.new("Weld")
  163. Weld.Parent = plr.Character.Head
  164. Weld.Part0 = plr.Character.Head
  165. Weld.Part1 = Hair4
  166. Weld.C0 = CFrame.new(0, .8, 0.11) * CFrame.Angles(0,math.pi,0)
  167. SOUND = Instance.new("Sound")
  168. SOUND.Name = "SuperSaiyan"
  169. SOUND.Parent = plr.Character.Torso
  170. SOUND.SoundId = "rbxassetid://491515754"
  171. SOUND.MaxDistance = 450
  172. SOUND.Volume = 2
  173. SOUND.Looped = true
  174. SOUND:Play()
  175. for i = 1.25, 15, 0.25 do
  176. wait(1/20)
  177. Ball.Size = Vector3.new(i, i, i)
  178. end
  179. SOUND:Destroy()
  180. wait(5.1)
  181. FF = Instance.new("ForceField")
  182. FF.Parent = plr.Character
  183. Ball:Destroy()
  184. wait(5)
  185. Hair4:Destroy()
  186. FF:Destroy()
  187.  
  188. elseif msg == "stopArmFocus" then
  189. print("communication stop arm focus")
  190. communication:FireAllClients("stopArmFocusRelay", plr)
  191.  
  192. elseif msg == "insertJoint" then
  193. print("communication insert joint")
  194. communication:FireAllClients("relayInsertJoint", plr, arg1)
  195.  
  196. elseif msg == "resetLimb" then
  197. print("communication reset limb")
  198. communication:FireAllClients("resetLimb", plr, arg1)
  199. --]]
  200. if msg == "wantsHomeGK" then
  201. print("communication wants home gk")
  202. if game.Teams.T1.Goalkeeper.Value == nil then
  203. game.Teams.T1.Goalkeeper.Value = plr
  204. communication:FireAllClients("homeGKTaken")
  205. communication:FireClient(plr, "youAreKeeper")
  206. local tools = game.ReplicatedStorage.GKTool.GK:Clone()
  207. local toolsForSG = game.ReplicatedStorage.GKTool.GK:Clone()
  208. tools.Parent = plr.Backpack
  209. toolsForSG.Parent = plr.StarterGear
  210. else
  211. communication:FireClient(plr, "homeGKTaken")
  212. end
  213.  
  214. elseif msg == "wantsAwayGK" then
  215. print("communication wants away gk")
  216. if game.Teams.T2.Goalkeeper.Value == nil then
  217. game.Teams.T2.Goalkeeper.Value = plr
  218. communication:FireAllClients("awayGKTaken")
  219. communication:FireClient(plr, "youAreKeeper")
  220. local tools = game.ReplicatedStorage.GKTool.GK:Clone()
  221. local toolsForSG = game.ReplicatedStorage.GKTool.GK:Clone()
  222. tools.Parent = plr.Backpack
  223. toolsForSG.Parent = plr.StarterGear
  224. else
  225. communication:FireClient(plr, "awayGKTaken")
  226. end
  227.  
  228. elseif msg == "quitGK" then
  229. print("communication quit gk")
  230. if plr == game.Teams.T1.Goalkeeper.Value then
  231. game.Teams.T1.Goalkeeper.Value = nil
  232. communication:FireAllClients("homeGKClear")
  233. elseif plr == game.Teams.T2.Goalkeeper.Value then
  234. game.Teams.T2.Goalkeeper.Value = nil
  235. communication:FireAllClients("awayGKClear")
  236. end
  237. if plr.Backpack:FindFirstChild("GK") == nil then
  238. if plr.Character:FindFirstChild("GK") then
  239. plr.Character.GK:Destroy()
  240. end
  241. else
  242. plr.Backpack.GK:Destroy()
  243. end
  244. if plr.StarterGear:FindFirstChild("GK") == nil then
  245. if plr.Character:FindFirstChild("GK") then
  246. plr.Character.GK:Destroy()
  247. end
  248. else
  249. plr.StarterGear.GK:Destroy()
  250. end
  251. elseif msg == "passRequest" then
  252. print("communication pass request")
  253. local targetPos = arg1
  254.  
  255. for _,v in pairs(game.Players:GetChildren()) do
  256. wait()
  257. if v.Character ~= nil then
  258. if v.TeamColor == plr.TeamColor then
  259. communication:FireClient(v, "oiJezzaHowsYourTouch", targetPos, plr.Name)
  260. end
  261. end
  262. end
  263. elseif msg == "switchHalvesOS" then
  264. local oW = workspace.RIFAPitch:WaitForChild("OffsideSystem")
  265. oW.switchedHalf.Value = arg1
  266. end
  267. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement