@NewRidStudios
local CanTouchDeb = true
local function NewStartGame()
-- Check Update --
CameraFolder.Parent:GetAttributeChangedSignal('GameStarted'):Connect(function()
if CameraFolder.Parent:GetAttribute('GameStarted',true) then
-- Setup Game --
local Char1 = workspace:FindFirstChild(QueuingFolder.TeamBlue:GetAttribute('QueuedPlr'))
local Char2 = workspace:FindFirstChild(QueuingFolder.TeamRed:GetAttribute('QueuedPlr'))
-- Constants / Camera --
local IntroCam1 = CameraFolder:FindFirstChild('IntroCam1')
local IntroCam2 = CameraFolder:FindFirstChild('IntroCam2')
local RedCamera = CameraFolder:FindFirstChild('RedCamera')
local BlueCamera = CameraFolder:FindFirstChild('BlueCamera')
-- Call Events --
task.wait(0.2)
MainEvent:FireClient(PlrService:GetPlayerFromCharacter(Char1),{IntroCam1,BlueCamera},'To IntroCamera')
MainEvent:FireClient(PlrService:GetPlayerFromCharacter(Char2),{IntroCam2,RedCamera},'To IntroCamera')
QueueEvent:FireClient(PlrService:GetPlayerFromCharacter(Char1),'HideLeave')
QueueEvent:FireClient(PlrService:GetPlayerFromCharacter(Char2),'HideLeave')
-- Teleport --
Char1.HumanoidRootPart.CFrame = CFrame.new(FloorModel.Blue.Position.X,Char1.HumanoidRootPart.Position.Y,FloorModel.Blue.Position.Z)
Char1.HumanoidRootPart.Orientation = Vector3.new(0,180,0)
Char2.HumanoidRootPart.CFrame = CFrame.new(FloorModel.Red.Position.X,Char2.HumanoidRootPart.Position.Y,FloorModel.Red.Position.Z)
Char2.HumanoidRootPart.Orientation = Vector3.new(0,0,0)
-- Create Stuff --
Char1:SetAttribute('PartSide','ToRed')
Char2:SetAttribute('PartSide','ToBlue')
-- Functions --
local function SetupGame()
-- Health / Attribute --
Char1:SetAttribute('Health',100)
Char2:SetAttribute('Health',100)
-- Make It Pads Not Getonable --
local RedPad = QueuingFolder:FindFirstChild('TeamRed')
local BluePad = QueuingFolder:FindFirstChild('TeamBlue')
-- Update --
RedPad:SetAttribute('Queueable',false)
BluePad:SetAttribute('Queueable',false)
end
-- Call Functons --
SetupGame()
task.wait(6)
--EndGame()
-- Now We Start --
MainEvent:FireClient(PlrService:GetPlayerFromCharacter(Char1),'Slapping')
QueueEvent:FireClient(PlrService:GetPlayerFromCharacter(Char1),'ShowInstructor')
MainEvent:FireClient(PlrService:GetPlayerFromCharacter(Char2),'NotSlapping')
-- Show Health --
QueueEvent:FireClient(PlrService:GetPlayerFromCharacter(Char1),'ShowHealth')
QueueEvent:FireClient(PlrService:GetPlayerFromCharacter(Char2),'ShowHealth')
-- UI Principal --
QueueEvent:FireClient(PlrService:GetPlayerFromCharacter(Char1),'ShowClocker')
QueueEvent:FireClient(PlrService:GetPlayerFromCharacter(Char2),'HideClocker')
-- Enable Scripts --
Char2.Hitboxes.HeadBox['-Server'].Enabled = true
Char2.Humanoid.HeadControl.Enabled = true
-- On Touched / Character 2 --
Char2.Hitboxes.HeadBox.Touched:Connect(function(BasePart)
-- Check x2 --
if BasePart.Parent.Parent:FindFirstChild('Humanoid') and BasePart.Parent.Parent:IsA('Model') and BasePart.Name == 'HandBox' then
if CanTouchDeb == false then
-- Update --
CanTouchDeb = true
MainEvent:FireClient(PlrService:GetPlayerFromCharacter(BasePart.Parent.Parent),'Touched Part')
--MainEvent:FireClient(PlrService:GetPlayerFromCharacter(Char2),'GotSlapped')
--MainEvent:FireClient(PlrService:GetPlayerFromCharacter(Char1),'JustSlapped')
-- Update Current Slapper --
MainEvent:FireClient(PlrService:GetPlayerFromCharacter(Char2),'Slapping')
MainEvent:FireClient(PlrService:GetPlayerFromCharacter(Char1),'NotSlapping')
-- UI Principal --
QueueEvent:FireClient(PlrService:GetPlayerFromCharacter(Char2),'ShowClocker')
QueueEvent:FireClient(PlrService:GetPlayerFromCharacter(Char1),'HideClocker')
QueueEvent:FireClient(PlrService:GetPlayerFromCharacter(Char2),'ShowInstructor')
-- Update --
Char2.Hitboxes.HeadBox['-Server'].Enabled = false
Char2.Humanoid.HeadControl.Enabled = false
-- Update --
Char1.Hitboxes.HeadBox['-Server'].Enabled = true
Char1.Humanoid.HeadControl.Enabled = true
end
end
end)
-- On Touched / Character 2 --
Char1.Hitboxes.HeadBox.Touched:Connect(function(BasePart)
-- Check x2 --
if BasePart.Parent.Parent:FindFirstChild('Humanoid') and BasePart.Parent.Parent:IsA('Model') and BasePart.Name == 'HandBox' then
if CanTouchDeb == false then
-- Update --
CanTouchDeb = true
MainEvent:FireClient(PlrService:GetPlayerFromCharacter(BasePart.Parent.Parent),'Touched Part')
--MainEvent:FireClient(PlrService:GetPlayerFromCharacter(Char1),'GotSlapped')
--MainEvent:FireClient(PlrService:GetPlayerFromCharacter(Char2),'JustSlapped')
-- Update Current Slapper --
MainEvent:FireClient(PlrService:GetPlayerFromCharacter(Char1),'Slapping')
MainEvent:FireClient(PlrService:GetPlayerFromCharacter(Char2),'NotSlapping')
-- UI Principal --
QueueEvent:FireClient(PlrService:GetPlayerFromCharacter(Char1),'ShowClocker')
QueueEvent:FireClient(PlrService:GetPlayerFromCharacter(Char2),'HideClocker')
QueueEvent:FireClient(PlrService:GetPlayerFromCharacter(Char1),'ShowInstructor')
-- Update --
Char1.Hitboxes.HeadBox['-Server'].Enabled = false
Char1.Humanoid.HeadControl.Enabled = false
-- Update --
Char2.Hitboxes.HeadBox['-Server'].Enabled = true
Char2.Humanoid.HeadControl.Enabled = true
end
end
end)
end
end)
-- Pads / Constants --
local BluePad = QueuingFolder:FindFirstChild('TeamBlue')
local RedPad = QueuingFolder:FindFirstChild('TeamRed')
-- Check Changed / Blue --
BluePad:GetAttributeChangedSignal('QueuedPlr'):Connect(function()
if BluePad:GetAttribute('QueuedPlr') ~= '' and RedPad:GetAttribute('QueuedPlr') ~= '' then
-- Update --
CameraFolder.Parent:SetAttribute('GameStarted',true)
end
-- Check --
if RedPad:GetAttribute('QueuedPlr') == '' then
CameraFolder.Parent:SetAttribute('GameStarted',false)
end
end)
-- Check Changed / Red --
RedPad:GetAttributeChangedSignal('QueuedPlr'):Connect(function()
if BluePad:GetAttribute('QueuedPlr') ~= '' and RedPad:GetAttribute('QueuedPlr') ~= '' then
-- Update --
CameraFolder.Parent:SetAttribute('GameStarted',true)
end
-- Check --
if BluePad:GetAttribute('QueuedPlr') == '' then
CameraFolder.Parent:SetAttribute('GameStarted',false)
end
end)
end
----
- What Should Be Sent (But I guess can be bypassed
-- OnServerEvent --
QueueEvent.OnServerEvent:Connect(function(LocalPlr,SentEvent)
-- Check --
if SentEvent == 'ReadyToSlap' then
task.wait(0.05)
CanTouchDeb = false
end
end)
----
-- Mouse Stuff With Box --
ConfirmBox.MouseEnter:Connect(function()
TweenService:Create(ConfirmBox.Arrow,TweenInfo.new(0.5,Enum.EasingStyle.Quint,Enum.EasingDirection.Out),{TextTransparency = 1}):Play()
TweenService:Create(ConfirmBox.Context,TweenInfo.new(0.5,Enum.EasingStyle.Quint,Enum.EasingDirection.Out),{TextTransparency = 1}):Play()
TweenService:Create(ConfirmBox.Arrow.TextStroke,TweenInfo.new(0.5,Enum.EasingStyle.Quint,Enum.EasingDirection.Out),{Transparency = 1}):Play()
TweenService:Create(ConfirmBox.Context.TextStroke,TweenInfo.new(0.5,Enum.EasingStyle.Quint,Enum.EasingDirection.Out),{Transparency = 1}):Play()
task.wait(1)
ConfirmBox.Visible = false
-- Fire To Server --
RemoteEvent:FireServer('ReadyToSlap')
end)
----