Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Made by Xerdai
- -- Variables
- local debris = game:GetService("Debris")
- local players = game:GetService("Players")
- local communication = game:GetService("ReplicatedStorage"):WaitForChild("Communication")
- --local stadiumChange = game:GetService("ReplicatedStorage"):WaitForChild("StadiumDisplay")
- -- messages:
- -- editLimbs
- -- resetWelds
- -- resetLimb
- -- runAnimation
- -- fouledPlayer
- -- moveCheck
- -- throwCheck
- -- saveBall
- -- wantsHomeGK
- -- wantsAwayGK
- -- quitGK
- -- local toolGui = game:GetService("ServerStorage"):WaitForChild("toolGUI")
- -- Methods
- --[[function getGroupId(name)
- -- GetCollisionGroupId will throw if it does not exist
- local ok, groupId = pcall(ps.GetCollisionGroupId, ps, name)
- return ok and groupId or nil
- end]]--
- -- events
- game.Teams.T1.PlayerRemoved:Connect(function(player)
- if game.Teams.T1.Goalkeeper.Value == player then
- print("T1 Goalkeeper, ".. tostring(player.Name)..", has left the team, GK tool available")
- game.Teams.T1.Goalkeeper.Value = nil
- end
- end)
- game.Teams.T2.PlayerRemoved:Connect(function(player)
- if game.Teams.T2.Goalkeeper.Value == player then
- print("T2 Goalkeeper, " .. tostring(player.Name) .. ", has left the team, GK tool available")
- game.Teams.T2.Goalkeeper.Value = nil
- end
- end)
- -- Gameplay
- communication.OnServerEvent:Connect(function(plr, msg, arg1, arg2, arg3, arg4, arg5)
- local ticc = tick()
- --[[if msg == "focusArm" then
- print("communication focus arm")
- communication:FireAllClients("focusArmRelay", plr, arg1, arg2)
- elseif msg == "focusTipArm" then
- print("communication focus tip arm")
- communication:FireAllClients("focusTipArmRelay", plr, arg1)
- elseif msg == "SpookySound" then
- print("communication spooky sound")
- SPOOKY_SONG = Instance.new("Sound")
- SPOOKY_SONG.Name = "SPOOKY"
- SPOOKY_SONG.Parent = plr.Character.Torso
- SPOOKY_SONG.SoundId = "rbxassetid://160442087"
- SPOOKY_SONG.MaxDistance = 140
- SPOOKY_SONG.Volume = 0
- SPOOKY_SONG.TimePosition = 0.3
- SPOOKY_SONG:Play()
- for i = 0, 1, 0.1 do
- wait(0.2)
- SPOOKY_SONG.Volume = i
- end
- SPOOKY_SONG.Volume = 1
- wait(12)
- for i = 1, 0, -0.1 do
- wait(0.2)
- SPOOKY_SONG.Volume = i
- end
- SPOOKY_SONG.Volume = 0
- SPOOKY_SONG:Destroy()
- elseif msg == "KetsuWoTaberu" then
- print("communication ketsu wo teberu")
- wait(4)
- if plr and plr.Character then
- local c = plr.Character;
- c.Archivable = true;
- local clone1 = c:Clone();
- local clone2 = c:Clone();
- clone1.Parent = workspace
- clone2.Parent = workspace
- clone1.Name = ""
- clone2.Name = ""
- clone1["Head"].Transparency = 1
- clone1["Torso"].Transparency = 1
- clone1["Left Arm"].Transparency = 1
- clone1["Right Arm"].Transparency = 1
- clone1["Left Leg"].Transparency = 1
- clone1["Right Leg"].Transparency = 1
- clone2["Head"].Transparency = 1
- clone2["Torso"].Transparency = 1
- clone2["Left Arm"].Transparency = 1
- clone2["Right Arm"].Transparency = 1
- clone2["Left Leg"].Transparency = 1
- clone2["Right Leg"].Transparency = 1
- clone1:MoveTo(c.Torso.Position + c.Torso.CFrame.lookVector * 2.5 + c.Torso.CFrame.rightVector * 5)
- clone2:MoveTo(c.Torso.Position + c.Torso.CFrame.lookVector * 2.5 + c.Torso.CFrame.rightVector * -5)
- for i = 1, 0, -0.2 do
- wait(1/20)
- clone1["Head"].Transparency = i
- clone1["Torso"].Transparency = i
- clone1["Left Arm"].Transparency = i
- clone1["Right Arm"].Transparency = i
- clone1["Left Leg"].Transparency = i
- clone1["Right Leg"].Transparency = i
- clone2["Head"].Transparency = i
- clone2["Torso"].Transparency = i
- clone2["Left Arm"].Transparency = i
- clone2["Right Arm"].Transparency = i
- clone2["Left Leg"].Transparency = i
- clone2["Right Leg"].Transparency = i
- end
- wait(1.9)
- for i = 0, 1, 0.2 do
- wait(1/20)
- clone1["Head"].Transparency = i
- clone1["Torso"].Transparency = i
- clone1["Left Arm"].Transparency = i
- clone1["Right Arm"].Transparency = i
- clone1["Left Leg"].Transparency = i
- clone1["Right Leg"].Transparency = i
- clone2["Head"].Transparency = i
- clone2["Torso"].Transparency = i
- clone2["Left Arm"].Transparency = i
- clone2["Right Arm"].Transparency = i
- clone2["Left Leg"].Transparency = i
- clone2["Right Leg"].Transparency = i
- end
- clone1:Destroy()
- clone2:Destroy()
- end
- elseif msg == "SuperSaiyan" then
- print("communication super saiyan")
- wait(1)
- local Ball = Instance.new("Part")
- Ball.Shape = "Ball"
- Ball.CanCollide = false
- Ball.Color = Color3.new(0/255, 155/255, 255/255)
- Ball.Transparency = 0.75
- Ball.Anchored = true
- Ball.Material = Enum.Material.Neon
- Ball.Size = Vector3.new(1,1,1)
- Ball.Position = plr.Character.Torso.Position
- Ball.Parent = workspace
- local Hair4 = game.ServerStorage.SuperSaiyan:Clone()
- Hair4.Parent = plr.Character
- Hair4.Name = "Hair"
- Hair4.CanCollide = false
- Hair4.Locked = true
- Hair4.CFrame = plr.Character.Torso.CFrame
- local Weld = Instance.new("Weld")
- Weld.Parent = plr.Character.Head
- Weld.Part0 = plr.Character.Head
- Weld.Part1 = Hair4
- Weld.C0 = CFrame.new(0, .8, 0.11) * CFrame.Angles(0,math.pi,0)
- SOUND = Instance.new("Sound")
- SOUND.Name = "SuperSaiyan"
- SOUND.Parent = plr.Character.Torso
- SOUND.SoundId = "rbxassetid://491515754"
- SOUND.MaxDistance = 450
- SOUND.Volume = 2
- SOUND.Looped = true
- SOUND:Play()
- for i = 1.25, 15, 0.25 do
- wait(1/20)
- Ball.Size = Vector3.new(i, i, i)
- end
- SOUND:Destroy()
- wait(5.1)
- FF = Instance.new("ForceField")
- FF.Parent = plr.Character
- Ball:Destroy()
- wait(5)
- Hair4:Destroy()
- FF:Destroy()
- elseif msg == "stopArmFocus" then
- print("communication stop arm focus")
- communication:FireAllClients("stopArmFocusRelay", plr)
- elseif msg == "insertJoint" then
- print("communication insert joint")
- communication:FireAllClients("relayInsertJoint", plr, arg1)
- elseif msg == "resetLimb" then
- print("communication reset limb")
- communication:FireAllClients("resetLimb", plr, arg1)
- --]]
- if msg == "wantsHomeGK" then
- print("communication wants home gk")
- if game.Teams.T1.Goalkeeper.Value == nil then
- game.Teams.T1.Goalkeeper.Value = plr
- communication:FireAllClients("homeGKTaken")
- communication:FireClient(plr, "youAreKeeper")
- local tools = game.ReplicatedStorage.GKTool.GK:Clone()
- local toolsForSG = game.ReplicatedStorage.GKTool.GK:Clone()
- tools.Parent = plr.Backpack
- toolsForSG.Parent = plr.StarterGear
- else
- communication:FireClient(plr, "homeGKTaken")
- end
- elseif msg == "wantsAwayGK" then
- print("communication wants away gk")
- if game.Teams.T2.Goalkeeper.Value == nil then
- game.Teams.T2.Goalkeeper.Value = plr
- communication:FireAllClients("awayGKTaken")
- communication:FireClient(plr, "youAreKeeper")
- local tools = game.ReplicatedStorage.GKTool.GK:Clone()
- local toolsForSG = game.ReplicatedStorage.GKTool.GK:Clone()
- tools.Parent = plr.Backpack
- toolsForSG.Parent = plr.StarterGear
- else
- communication:FireClient(plr, "awayGKTaken")
- end
- elseif msg == "quitGK" then
- print("communication quit gk")
- if plr == game.Teams.T1.Goalkeeper.Value then
- game.Teams.T1.Goalkeeper.Value = nil
- communication:FireAllClients("homeGKClear")
- elseif plr == game.Teams.T2.Goalkeeper.Value then
- game.Teams.T2.Goalkeeper.Value = nil
- communication:FireAllClients("awayGKClear")
- end
- if plr.Backpack:FindFirstChild("GK") == nil then
- if plr.Character:FindFirstChild("GK") then
- plr.Character.GK:Destroy()
- end
- else
- plr.Backpack.GK:Destroy()
- end
- if plr.StarterGear:FindFirstChild("GK") == nil then
- if plr.Character:FindFirstChild("GK") then
- plr.Character.GK:Destroy()
- end
- else
- plr.StarterGear.GK:Destroy()
- end
- elseif msg == "passRequest" then
- print("communication pass request")
- local targetPos = arg1
- for _,v in pairs(game.Players:GetChildren()) do
- wait()
- if v.Character ~= nil then
- if v.TeamColor == plr.TeamColor then
- communication:FireClient(v, "oiJezzaHowsYourTouch", targetPos, plr.Name)
- end
- end
- end
- elseif msg == "switchHalvesOS" then
- local oW = workspace.RIFAPitch:WaitForChild("OffsideSystem")
- oW.switchedHalf.Value = arg1
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement