hello,
im doing a sort of auto match for a soccer game
basically i want that after pressed cancel match ( that will reset ) i want it to do same the process like at the start
here the main script:
local PP = game.Workspace.StadiumPlatform.GoldTrophy.Mogus
local Pad1 = game.ServerStorage.Pitch1Pads:WaitForChild("PlayerPad1")
local Pad2 = game.ServerStorage.Pitch1Pads:WaitForChild("PlayerPad2")
local Pad3 = game.ServerStorage.Pitch1Pads:WaitForChild("PlayerPad3")
local Pad4 = game.ServerStorage.Pitch1Pads:WaitForChild("PlayerPad4")
local Pad5 = game.ServerStorage.Pitch1Pads:WaitForChild("PlayerPad5")
local Pad6 = game.ServerStorage.Pitch1Pads:WaitForChild("PlayerPad6")
local Pad7 = game.ServerStorage.Pitch1Pads:WaitForChild("PlayerPad7")
local Pad8 = game.ServerStorage.Pitch1Pads:WaitForChild("PlayerPad8")
local Frame = script.Parent.HostUI.Frame
PP.Triggered:Connect(function(player)
Pad1:Clone().Parent = game.Workspace
Pad2:Clone().Parent = game.Workspace
Pad3:Clone().Parent = game.Workspace
Pad4:Clone().Parent = game.Workspace
Pad5:Clone().Parent = game.Workspace
Pad6:Clone().Parent = game.Workspace
Pad7:Clone().Parent = game.Workspace
Pad8:Clone().Parent = game.Workspace
game.Workspace.StadiumPlatform:Remove()
player.Character.HumanoidRootPart.CFrame = CFrame.new(workspace:WaitForChild("PlayerPad1").PlayerPlate.Position) or
player.Character.HumanoidRootPart.CFrame == CFrame.new(workspace:WaitForChild("PlayerPad2").PlayerPlate.Position) or
player.Character.HumanoidRootPart.CFrame == CFrame.new(workspace:WaitForChild("PlayerPad3").PlayerPlate.Position) or
player.Character.HumanoidRootPart.CFrame == CFrame.new(workspace:WaitForChild("PlayerPad4").PlayerPlate.Position) or
player.Character.HumanoidRootPart.CFrame == CFrame.new(workspace:WaitForChild("PlayerPad5").PlayerPlate.Position) or
player.Character.HumanoidRootPart.CFrame == CFrame.new(workspace:WaitForChild("PlayerPad6").PlayerPlate.Position) or
player.Character.HumanoidRootPart.CFrame == CFrame.new(workspace:WaitForChild("PlayerPad7").PlayerPlate.Position) or
player.Character.HumanoidRootPart.CFrame == CFrame.new(workspace:WaitForChild("PlayerPad8").PlayerPlate.Position)
player.Character.Humanoid.WalkSpeed = 0
player.Character.Humanoid.JumpHeight = 0
Frame:TweenPosition(
UDim2.new(0, 10, 0.01, 0),
Enum.EasingDirection.Out,
Enum.EasingStyle.Quint,
1,
false)
Frame.Visible = true
end)
the local script inside the cancel match buttom:
local StarterGUI = script.Parent.Parent.Parent
local CancelMatch = StarterGUI.Frame.Cancel
local Frame = StarterGUI.Frame
local Base = game.Workspace.StadiumPlatform
local PP = Base.GoldTrophy.Mogus
local player = game:GetService("Players").LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
CancelMatch.MouseButton1Down:Connect(function()
game.Workspace:WaitForChild("PlayerPad1"):Remove()
game.Workspace:WaitForChild("PlayerPad2"):Remove()
game.Workspace:WaitForChild("PlayerPad3"):Remove()
game.Workspace:WaitForChild("PlayerPad4"):Remove()
game.Workspace:WaitForChild("PlayerPad5"):Remove()
game.Workspace:WaitForChild("PlayerPad6"):Remove()
game.Workspace:WaitForChild("PlayerPad7"):Remove()
game.Workspace:WaitForChild("PlayerPad8"):Remove()
Base:Clone().Parent = game.Workspace
player.Character.HumanoidRootPart.CFrame = CFrame.new(workspace.CancelMatchTP.Position)
player.Character.Humanoid.WalkSpeed = 16
player.Character.Humanoid.JumpHeight = 7.2
Frame:TweenPosition(
UDim2.new(0, 10, -0.4, 0),
Enum.EasingDirection.Out,
Enum.EasingStyle.Quint,
1,
false)
wait(1)
Frame.Visible = false
end)
how do i make it so it does the same process (same at the start of the video) everytime?