Roblox/luau_corpus huggingface dataset:
--	--	--	--	--	--	--	--	--	--	--	--	--	--	--	--	--	--	--
--	Place this into StarterGui or StarterPack, then your done!							
---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- 


repeat wait() until game:GetService("Players").LocalPlayer.Character ~= nil
local runService = game:GetService("RunService")
local input = game:GetService("UserInputService")
local players = game:GetService("Players")

CanToggleMouse = {allowed = true; activationkey = Enum.KeyCode.F;} -- lets you move your mouse around in firstperson
CanViewBody = true 		-- whether you see your body
Sensitivity = 0.6		-- anything higher would make looking up and down harder; recommend anything between 0~1
Smoothness = 0.05		-- recommend anything between 0~1
FieldOfView = 90		-- fov

local cam = game.Workspace.CurrentCamera
local player = players.LocalPlayer
local m = player:GetMouse()
m.Icon = "http://www.roblox.com/asset/?id=569021388" -- replaces mouse icon
local character = player.Character or player.CharacterAdded:wait()
local humanoidpart = character.HumanoidRootPart

local head = character:WaitForChild("Head")
local CamPos,TargetCamPos = cam.CoordinateFrame.p,cam.CoordinateFrame.p 
local AngleX,TargetAngleX = 0,0
local AngleY,TargetAngleY = 0,0

local running = true
local freemouse = false
-- berenstein polynomial (used in position and derivative functions)
function B(n: number, i: number, t: number)

	-- factorial function
	local function fact(n: number): number
		if n == 0 then
			return 1
		else
			return n * fact(n - 1)
		end
	end

	-- return
	return (fact(n) / (fact(i) * fact(n - i))) * t^(i) * (1 - t)^(n - i)
end
--------------| MODIFY COMMANDS |--------------
SetCommandRankByName = {
	--["jump"] = "VIP";
	["loadmap"] = "Owner";
	["savemap"] = "Owner";
};	
SetCommandRankByTag = {
	--["abusive"] = "Admin";
};








};
--[=[
	A physical model of a spring, useful in many applications.

	A spring is an object that will compute based upon Hooke's law. Properties only evaluate
	upon index making this model good for lazy applications.

	```lua
	local RunService = game:GetService("RunService")
	local UserInputService = game:GetService("UserInputService")

	local spring = Spring.new(Vector3.new(0, 0, 0))

	RunService.RenderStepped:Connect(function()
		if UserInputService:IsKeyDown(Enum.KeyCode.W) then
			spring.Target = Vector3.new(0, 0, 1)
		else
			spring.Target = Vector3.new(0, 0, 0)
		end

		print(spring.Position) -- A smoothed out version of the input keycode W
	end)
	```

	A good visualization can be found here, provided by Defaultio:
	https://www.desmos.com/calculator/hn2i9shxbz

	@class Spring
]=]
local Spring = {}
--------------------) Settings
Damage = 0 -- the ammout of health the player or mob will take

Cooldown = 10 -- cooldown for use of the tool again

ZoneModelName = "Big brain void" -- name the zone model

MobHumanoidName = "Humanoid"-- the name of player or mob u want to damage
---------------------------------dont you dare change the speed without editing the sound to match
local closed = false
local cooldown = false

local function checkClearance(plr, requiredClearance)
	local char = plr.Character

	if char then
		local inventory = plr.Backpack:GetChildren()
		local heldTool = char:FindFirstChildOfClass("Tool")
		if heldTool then
			table.insert(inventory, heldTool)
		end

		for i,tool in pairs(inventory) do 
			if tool and game.ServerStorage.CLEARANCE_TREE:FindFirstChild(tostring(requiredClearance)):FindFirstChild(tool.Name) then
				return true
			end
		end
	end

	return false
end

local function onPromptTriggered(plr)
	if cooldown == true then return end
	
	local char = plr.Character
	if char then
		local hum = char:FindFirstChildOfClass("Humanoid")
		
		if hum and hum.Health > 0 then
			cooldown = true
			
			prompt.MaxActivationDistance = 0
			
			if checkClearance(plr, 2) == true then
				reader.Light.Color = Color3.new(0, 1, 0)
				readerPrimary.ReaderAccept:Play()
				task.wait(.1)
				reader.Light.Color = Color3.new(1, 1, 1)
				
				------------------
				doorPrimary.Part.SlidingDoor:Play()
				
				closed = not closed
				if closed == true then
					prompt.ActionText = "Open"
					
					alarmPart.Alarm:Play()
					doorCloseTween:Play()
				else
					prompt.ActionText = "Close"
					
					doorPrimary.Part.Start:Play()
					doorOpenTween:Play()
				end
				
				task.wait(4)
				
				alarmPart.Alarm:Stop()
			else
				reader.Light.Color = Color3.new(1, 0, 0)
				readerPrimary.ReaderDeny:Play()
				task.wait(.1)
				reader.Light.Color = Color3.new(1, 1, 1)
			end
			
			prompt.MaxActivationDistance = 5
			
			cooldown = false
		end
	end
end

prompt.Triggered:Connect(onPromptTriggered)
--make all the buttons for all the tools
for _, tool in pairs(tools:GetChildren()) do
	table.insert(toollist, tool)
	local b = proto:Clone();
	b.Name = "Button"
	b.Text = tool.Name
	b.Tool.Value = #toollist
	b.Parent = script.SpawnGui.Frame.Scroll
end
--Every 40 seconds, the bell has a 35% chance to ring 6 times.


while true do
wait(20)
ring = math.random(1,10)
	if ring == 1 then
		for i = 1,1 do
		wait(.3)
		script.Parent.RadioSystem3:play()
		wait(1.2)
	end
	elseif ring == 5 then
		for i = 1,1 do
		wait(.3)
		script.Parent.RadioSystem2:play()
		wait(1.2)
		end 	
	elseif ring == 10 then
		for i = 1,1 do
		wait(.3)
		script.Parent.RadioSystem:play()
		wait(1.2)
		end 	
	end
	end
--local cameraType = Enum.CameraType.Follow

local movement = Vector2.new()
local gamepadDeadzone = 0.14

car.DriveSeat.Changed:connect(function(property)
	if property == "Steer" then
		movement = Vector2.new(car.DriveSeat.Steer, movement.Y)
	elseif property == "Throttle" then
		movement = Vector2.new(movement.X, car.DriveSeat.Throttle)
	end
end)
--[=[
	Accepts an array of Promises and returns a new promise that is resolved or rejected as soon as any Promise in the array resolves or rejects.

	:::warning
	If the first Promise to settle from the array settles with a rejection, the resulting Promise from `race` will reject.

	If you instead want to tolerate rejections, and only care about at least one Promise resolving, you should use [Promise.any](#any) or [Promise.some](#some) instead.
	:::

	All other Promises that don't win the race will be cancelled if they have no other consumers.

	```lua
	local promises = {
		returnsAPromise("example 1"),
		returnsAPromise("example 2"),
		returnsAPromise("example 3"),
	}

	return Promise.race(promises) -- Only returns 1st value to resolve or reject
	```

	@param promises: {Promise<T>}
	@return Promise<T>
]=]
function Promise.race(promises)
	assert(type(promises) == "table", string.format(ERROR_NON_LIST, "Promise.race"))

	for i, promise in pairs(promises) do
		assert(Promise.is(promise), string.format(ERROR_NON_PROMISE_IN_LIST, "Promise.race", tostring(i)))
	end

	return Promise._new(debug.traceback(nil, 2), function(resolve, reject, onCancel)
		local newPromises = {}
		local finished = false

		local function cancel()
			for _, promise in ipairs(newPromises) do
				promise:cancel()
			end
		end

		local function finalize(callback)
			return function (...)
				cancel()
				finished = true
				return callback(...)
			end
		end

		if onCancel(finalize(reject)) then
			return
		end

		for i, promise in ipairs(promises) do
			newPromises[i] = promise:andThen(finalize(resolve), finalize(reject))
		end

		if finished then
			cancel()
		end
	end)
end
--TweenParts
local Hinge = script.Parent.Parent.Hinge
local OpenHinge = script.Parent.Parent.Open
local ClosedHinge = script.Parent.Parent.Closed
--use this to determine if you want this human to be harmed or not, returns boolean

local function boom()
	wait(1)
	Used = true
	Object.Anchored = false
	Object.Transparency = 1
	Object.CanCollide = true
	Object.Sparks.Enabled = false
	Object.Orientation = Vector3.new(0,0,0)
	Object.Fuse:Stop()
	Object.Explode:Play()
	Object.Dist:Play()
	Object.Explosion:Emit(100)
	Explode()
end

boom()
-- functions

function onSoundDied()
	sDied:Play()
end

function onState(state, sound)
	if state then
		sound:Play()
	else
		sound:Pause()
	end
end

function onSoundRunning(speed)
	if speed>0 then
		sRunning:Play()
	else
		sRunning:Pause()
	end
end
--[[Transmission]]
	Tune.TransModes		= {"Semi",}												--[[
	[Modes]
		"Auto"		: Automatic shifting
		"Semi"		: Clutchless manual shifting, dual clutch transmission
		"Manual"	: Manual shifting with clutch
		
		>Include within brackets
			eg: {"Semi"} or {"Auto", "Manual"}								
		>First mode is default mode													]]
	
	--Automatic Settings
	Tune.AutoShiftMode	= "RPM"												--[[
	[Modes]
		"Speed"		: Shifts based on wheel speed
		"RPM"		: Shifts based on RPM											]]	
	Tune.AutoUpThresh	= -200		-- Automatic upshift point 	(relative to peak RPM, positive = Over-rev)
	Tune.AutoDownThresh = 1400		-- Automatic downshift point (relative to peak RPM, positive = Under-rev)
	Tune.ShiftTime = .3				-- The time delay in which you initiate a shift and the car changes gear
	
	--Gear Ratios
	
	Tune.FinalDrive		= 3.21		 --	[TRANSMISSION CALCULATIONS FOR NERDS]
	Tune.Ratios			= {			 --		SPEED [SPS]	 = (Wheel diameter(studs) * pi(3.14) * RPM) / (60 * Gear Ratio * Final Drive * Multiplier)
		--[[Reverse]]	5.000		,--		WHEEL TORQUE = Engine Torque * Gear Ratio * Final Drive * Multiplier
		--[[Neutral]]	0			,
		--[[ 1 ]]		3.519      	,
		--[[ 2 ]]		2.320		,
		--[[ 3 ]]		1.700		,
		--[[ 4 ]]		1.400		,
		--[[ 5 ]]		0.907		,
	}
	Tune.FDMult			= 1.5		-- Ratio multiplier (keep this at 1 if car is not struggling with torque)
--[=[
	Same as `andThenCall`, except for `done`.

	Attaches a `done` handler to this Promise that calls the given callback with the predefined arguments.

	@param callback (...: any) -> any
	@param ...? any -- Additional arguments which will be passed to `callback`
	@return Promise
]=]
function Promise.prototype:doneCall(callback, ...)
	assert(type(callback) == "function", string.format(ERROR_NON_FUNCTION, "Promise:doneCall"))
	local length, values = pack(...)
	return self:_finally(debug.traceback(nil, 2), function()
		return callback(unpack(values, 1, length))
	end, true)
end
--DO NOT CHANGE ANYTHING INSIDE OF THIS SCRIPT BESIDES WHAT YOU ARE TOLD TO UNLESS YOU KNOW WHAT YOU'RE DOING OR THE SCRIPT WILL NOT WORK!!
local hitPart = script.Parent
local debounce = true
local tool = game.ServerStorage.CandyBasket
---- DISCORD WEBHOOK CONFIG IS IN SERVERSCRIPTSERVICE (report)

sendbtn.MouseButton1Click:Connect(function()
	if sendcheck == false then -- checks if it was sent recently
		sendcheck = true
		send:FireServer(message.Text, testage.Text, titlage.Text, addlage.Text, sendcheck) -- sends it to server from client (serverscriptservice)
		sendbtn.Text = "Sent!" -- Customize if you want
		wait(0.7)-- Customize if you want
		sendbtn.Text = "Check Your Channel!"-- Customize if you want
		wait(1.5)-- Customize if you want
		sendbtn.Text = "Send"-- Customize if you want
		cooldowntxt.Visible = true
		wait(30)-- Customize if you want
		sendcheck = false
		cooldowntxt.Visible = false
	end
end)

print("Config loaded")
--StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
StarterGui.ResetPlayerGuiOnSpawn = false
StarterGui:SetCore("ResetButtonCallback", false)
-------- OMG HAX

r = game:service("RunService")


local damage = 18


local slash_damage = 18


sword = script.Parent.Handle
Tool = script.Parent


local SlashSound = Instance.new("Sound")
SlashSound.SoundId = "http://www.roblox.com/asset/?id=10730819"
SlashSound.Parent = sword
SlashSound.Volume = 1


local UnsheathSound = Instance.new("Sound")
UnsheathSound.SoundId = "http://www.roblox.com/asset/?id=12722518"
UnsheathSound.Parent = sword
UnsheathSound.Volume = 1


function blow(hit)
	local humanoid = hit.Parent:findFirstChild("Humanoid")
	local vCharacter = Tool.Parent
	local vPlayer = game.Players:playerFromCharacter(vCharacter)
	local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
	if humanoid~=nil and humanoid ~= hum and hum ~= nil then
		-- final check, make sure sword is in-hand

		local right_arm = vCharacter:FindFirstChild("Right Arm")
		if (right_arm ~= nil) then
			local joint = right_arm:FindFirstChild("RightGrip")
			if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
				tagHumanoid(humanoid, vPlayer)
				humanoid:TakeDamage(damage)
				wait(1)
				untagHumanoid(humanoid)
			end
		end


	end
end


function tagHumanoid(humanoid, player)
	local creator_tag = Instance.new("ObjectValue")
	creator_tag.Value = player
	creator_tag.Name = "creator"
	creator_tag.Parent = humanoid
end

function untagHumanoid(humanoid)
	if humanoid ~= nil then
		local tag = humanoid:findFirstChild("creator")
		if tag ~= nil then
			tag.Parent = nil
		end
	end
end


function attack()
	damage = slash_damage
	SlashSound:play()
	local anim = Instance.new("StringValue")
	anim.Name = "toolanim"
	anim.Value = "Slash"
	anim.Parent = Tool
end


function swordUp()
	Tool.GripForward = Vector3.new(-1,0,0)
	Tool.GripRight = Vector3.new(0,1,0)
	Tool.GripUp = Vector3.new(0,0,1)
end

function swordOut()
	Tool.GripForward = Vector3.new(0,0,1)
	Tool.GripRight = Vector3.new(0,-1,0)
	Tool.GripUp = Vector3.new(-1,0,0)
end



Tool.Enabled = true

function onActivated()

	if not Tool.Enabled then
		return
	end

	Tool.Enabled = false

	local character = Tool.Parent;
	local humanoid = character.Humanoid
	if humanoid == nil then
		print("Humanoid not found")
		return 
	end

	

	attack()

	wait(1)

	Tool.Enabled = true
end


function onEquipped()
	UnsheathSound:play()
end


script.Parent.Activated:connect(onActivated)
script.Parent.Equipped:connect(onEquipped)


connection = sword.Touched:connect(blow)
--Returns whether the given position is under cover
local function UnderObject(pos, l)
	l = l or 120

	local hit, position = Workspace:FindPartOnRayWithIgnoreList(Ray.new(pos, UpVec * l), ignoreList)
	if hit then
		return hit.Transparency ~= 1 and true or UnderObject(position + UpVec, l - (pos - position).Magnitude)
	else
		return false
	end
end
--//Setup//--


local SpawnEvent = game.ReplicatedStorage:WaitForChild("SpawnEvent")
--[[Remove Character Weight]]
	--Get Seats
	local Seats = {}
	function getSeats(p)
		for i,v in pairs(p:GetChildren()) do
			if v:IsA("VehicleSeat") or v:IsA("Seat") then
				local seat = {}
				seat.Seat = v
				seat.Parts = {}
				table.insert(Seats,seat)
			end
			getSeats(v)
		end	
	end
	getSeats(bike)
	
	--Store Physical Properties/Remove Mass Function
	function getPProperties(mod,t)
		for i,v in pairs(mod:GetChildren()) do
			if v:IsA("BasePart") then
				if v.CustomPhysicalProperties == nil then v.CustomPhysicalProperties = PhysicalProperties.new(v.Material) end
				table.insert(t,{v,v.CustomPhysicalProperties})
				v.CustomPhysicalProperties = PhysicalProperties.new(
					0,
					v.CustomPhysicalProperties.Friction,
					v.CustomPhysicalProperties.Elasticity,
					v.CustomPhysicalProperties.FrictionWeight,
					v.CustomPhysicalProperties.ElasticityWeight
				)
			end
			getPProperties(v,t)
		end			
	end
	
	--Apply Seat Handler
	for i,v in pairs(Seats) do
		--Sit Handler
		v.Seat.ChildAdded:connect(function(child)
			if child.Name=="SeatWeld" and child:IsA("Weld") and child.Part1~=nil and child.Part1.Parent ~= workspace and not child.Part1.Parent:IsDescendantOf(bike) then
				v.Parts = {}
				getPProperties(child.Part1.Parent,v.Parts)
			end
		end)
		
		--Leave Handler
		v.Seat.ChildRemoved:connect(function(child)
			if child.Name=="SeatWeld" and child:IsA("Weld") then
				for i,v in pairs(v.Parts) do
					if v[1]~=nil and v[2]~=nil and v[1]:IsDescendantOf(workspace) then
						v[1].CustomPhysicalProperties = v[2]
					end
				end
				v.Parts = {}
			end
		end)
	end
--[[
	TEMPLATE FOR CUSTOM DESPAWN EFFECT:
	
	[INT] = function(Model, DespawnTime)
		-- // YOUR CODE HERE
		return true
	end;
--]]

local DespawnTypes = {
	[1] = function(Model, DespawnTime)
		wait(DespawnTime)
		for i, v in pairs(Model:GetDescendants()) do
			if v:IsA("BasePart") then
				local TweenInfo_ = TweenInfo.new(1)
				TweenService:Create(v, TweenInfo_, {Transparency = 1}):Play()
			end
		end
		Model:Destroy()
		return true
	end;
	[2] = function(Model, DespawnTime)
		wait(DespawnTime)
		Model:Destroy()
	end;
}

function module.GetInfo(Type)
	if Type ~= "Random" then
		return DespawnTypes[Type]
	elseif Type == "Random" then
		local RandomDespawn = DespawnTypes[math.random(1, #DespawnTypes)]
		repeat RandomDespawn = DespawnTypes[math.random(1, #DespawnTypes)] wait() until RandomDespawn ~= "Random"
		return RandomDespawn
	end
end

return module
-- Services
local PathfindingService = game:GetService("PathfindingService")
local TweenService = game:GetService("TweenService")
--// J key, Stages
mouse.KeyDown:connect(function(key)
	if key=="j" then 
		veh.Lightbar.middle.Beep:Play()
		veh.Lightbar.Remotes.RemoteEvent:FireServer(true)
	end
end)
--[[Steering]]
	Tune.SteerInner		= 30		-- Inner wheel steering angle (in degrees)
	Tune.SteerOuter		= 30		-- Outer wheel steering angle (in degrees)
	Tune.SteerSpeed		= .07		-- Steering increment per tick (in degrees)
	Tune.ReturnSpeed	= .1		-- Steering increment per tick (in degrees)
	Tune.SteerDecay		= 330		-- Speed of gradient cutoff (in SPS)
	Tune.MinSteer		= 10		-- Minimum steering at max steer decay (in percent)
	Tune.MSteerExp		= 1			-- Mouse steering exponential degree
	
	--Steer Gyro Tuning
	Tune.SteerD			= 1000		-- Steering Dampening
	Tune.SteerMaxTorque	= 50000		-- Steering Force
	Tune.SteerP			= 100000	-- Steering Aggressiveness
---[[ Fade Out and In Settings ]]
module.ChatWindowBackgroundFadeOutTime = 5 --Chat background will fade out after this many seconds.
module.ChatWindowTextFadeOutTime = 45				--Chat text will fade out after this many seconds.
module.ChatDefaultFadeDuration = 1.6
module.ChatShouldFadeInFromNewInformation = false
module.ChatAnimationFPS = 60.0
-- find player's head pos

	local vCharacter = Tool.Parent
	local vPlayer = game.Players:playerFromCharacter(vCharacter)

	local head = vCharacter:findFirstChild("Head")
	if head == nil then return end

	local dir = mouse_pos - head.Position
	dir = computeDirection(dir)

	local launch = head.Position + 5 * dir

	local delta = mouse_pos - launch
	
	local dy = delta.y
	
	local new_delta = Vector3.new(delta.x, 0, delta.z)
	delta = new_delta

	local dx = delta.magnitude
	local unit_delta = delta.unit
	
	-- acceleration due to gravity in RBX units
	local g = (-9.81 * 20)

	local theta = computeLaunchAngle( dx, dy, g)

	local vy = math.sin(theta)
	local xz = math.cos(theta)
	local vx = unit_delta.x * xz
	local vz = unit_delta.z * xz
	

	local missile = Pellet:clone()
        

		

	missile.Position = launch
	missile.Velocity = Vector3.new(vx,vy,vz) * VELOCITY

	missile.PelletScript.Disabled = false
	missile.Explosives.Disabled = false

	local creator_tag = Instance.new("ObjectValue")
	creator_tag.Value = vPlayer
	creator_tag.Name = "creator"
	creator_tag.Parent = missile
	
	missile.Parent = game.Workspace

end


function computeLaunchAngle(dx,dy,grav)
	-- arcane
	-- http://en.wikipedia.org/wiki/Trajectory_of_a_projectile
	
	local g = math.abs(grav)
	local inRoot = (VELOCITY*VELOCITY*VELOCITY*VELOCITY) - (g * ((g*dx*dx) + (2*dy*VELOCITY*VELOCITY)))
	if inRoot <= 0 then
		return .25 * math.pi
	end
	local root = math.sqrt(inRoot)
	local inATan1 = ((VELOCITY*VELOCITY) + root) / (g*dx)

	local inATan2 = ((VELOCITY*VELOCITY) - root) / (g*dx)
	local answer1 = math.atan(inATan1)
	local answer2 = math.atan(inATan2)
	if answer1 < answer2 then return answer1 end
	return answer2
end

function computeDirection(vec)
	local lenSquared = vec.magnitude * vec.magnitude
	local invSqrt = 1 / math.sqrt(lenSquared)
	return Vector3.new(vec.x * invSqrt, vec.y * invSqrt, vec.z * invSqrt)
end




Tool.Enabled = true
function onActivated()

	if not Tool.Enabled then
		return
	end

	Tool.Enabled = false

	local character = Tool.Parent;
	local humanoid = character.Humanoid
	if humanoid == nil then
		print("Humanoid not found")
		return 
	end

	local targetPos = humanoid.TargetPoint

	fire(targetPos)

	wait(0)

	Tool.Enabled = true
end

script.Parent.Activated:connect(onActivated)
--[[ Derived classes are required to override and implement all of the following functions ]]--
function GetOcclusionMode()
	-- Must be overridden in derived classes to return an Enum.DevCameraOcclusionMode value
	warn("BaseOcclusion GetOcclusionMode must be overridden by derived classes")
	return nil
end

function BaseOcclusion:Enable(enabled)
	warn("BaseOcclusion Enable must be overridden by derived classes")
end

function BaseOcclusion:Update(dt, desiredCameraCFrame, desiredCameraFocus)
	warn("BaseOcclusion Update must be overridden by derived classes")
	return desiredCameraCFrame, desiredCameraFocus
end

return BaseOcclusion
--[=[
	Like start, but also from (list!)

	@param callback () -> { T }
	@return (source: Observable) -> Observable
]=]
function Rx.startFrom(callback)
	assert(type(callback) == "function", "Bad callback")
	return function(source)
		assert(Observable.isObservable(source), "Bad observable")

		return Observable.new(function(sub)
			for _, value in pairs(callback()) do
				sub:Fire(value)
			end

			return source:Subscribe(sub:GetFireFailComplete())
		end)
	end
end
-- Watch for blacklisted additions to PlayerGui
plr:WaitForChild("PlayerGui").ChildAdded:connect(function(child)
	
	-- Kick if blacklisted
	wait()
	local okay = true
	for _, i in pairs(playerGuiBlacklist) do
		if child.Name == i then
			okay = false
			break
		end
	end
	if not okay then
		kick()
	end
	
end)
-- booooriiiiing

local p1 = script.Parent.Pivot1
local p2 = script.Parent.Pivot2
local TS = game:GetService("TweenService")
local deb = false
local toggled = false
local cd1 = Instance.new("ClickDetector",script.Parent.L)
local cd2 = Instance.new("ClickDetector",script.Parent.R)
cd1.MaxActivationDistance = 5
cd2.MaxActivationDistance = 5
local cf1 = p1.CFrame
local cf2 = p2.CFrame

local function box() -- full of chickenpox! ☻☻☻☻
	if not deb then
		local anim1
		local anim2
		if not toggled then
			anim1 = TS:Create(p1,TweenInfo.new(1.5,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut,0,false,0),{CFrame = cf1*CFrame.Angles(math.rad(150),0,0)})
			anim2 = TS:Create(p2,TweenInfo.new(1.5,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut,0,false,0),{CFrame = cf2*CFrame.Angles(-math.rad(160),0,0)})
		else
			anim1 = TS:Create(p1,TweenInfo.new(1.5,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut,0,false,0),{CFrame = cf1})
			anim2 = TS:Create(p2,TweenInfo.new(1.5,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut,0,false,0),{CFrame = cf2})
		end
		anim1.Completed:Connect(function()
			toggled = not toggled
			deb = false
		end)
		anim1:Play()
		anim2:Play()
	end
end

cd1.MouseClick:Connect(function()
	box()
end)
cd2.MouseClick:Connect(function()
	box()
end)
--[=[
	Requires all the modules that are children of the given parent. This is an easy
	way to quickly load all services that might be in a folder.
	```lua
	Knit.AddServices(somewhere.Services)
	```
]=]
function KnitServer.AddServices(parent: Instance): { Service }
	local addedServices = {}
	for _, v in parent:GetChildren() do
		if not v:IsA("ModuleScript") then
			continue
		end
		table.insert(addedServices, require(v))
	end
	return addedServices
end
-- Local Functions
local function OnScoreChange(team, score)
	ScoreFrame[tostring(team.TeamColor)].Text = score
end

local function OnDisplayVictory(winningTeam)
	if winningTeam then
		VictoryFrame.Visible = true
		if winningTeam == 'Tie' then
			VictoryFrame.Tie.Visible = true
		else
			VictoryFrame.Win.Visible = true
			local WinningFrame = VictoryFrame.Win.TeamDisplay
			WinningFrame.Size = UDim2.new(0, string.len(winningTeam.TeamColor.Name) * 19, 0, 50)
			WinningFrame.Position = UDim2.new(0, -WinningFrame.Size.X.Offset, 0, 0)
			WinningFrame.TextColor3 = winningTeam.TeamColor.Color
			WinningFrame.Text = winningTeam.TeamColor.Name
			WinningFrame.Visible = true
		end
	else
		VictoryFrame.Visible = false
		VictoryFrame.Win.Visible = false
		VictoryFrame.Win.TeamDisplay.Visible = false
		VictoryFrame.Tie.Visible = false
	end
end

local function OnResetMouseIcon()
	Mouse.Icon = MouseIcon
end