Pinkstack/roblox-luau-corpus-text huggingface dataset:
-------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------



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

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

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

	if (toolAnim == "Lunge") then
		playToolAnimation("toollunge", 0, Humanoid, 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, Humanoid)
	elseif (pose == "Seated") then
		playAnimation("sit", 0.5, Humanoid)
		return
	elseif (pose == "Running") then
		playAnimation("walk", 0.2, Humanoid)
	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 = true
	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
--[[
		___      _______                _     
	   / _ |____/ ___/ /  ___ ____ ___ (_)__ 
	  / __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<
	 /_/ |_|   \___/_//_/\_,_/___/___/_/___/
 						SecondLogic @ Inspare
]]




local autoscaling	= false					--Estimates top speed

local UNITS	= {								--Click on speed to change units
											--First unit is default	
	{
		units			= "MPH"				,
		scaling			= (10/12) * (60/88)	, -- 1 stud : 10 inches | ft/s to MPH
		maxSpeed		= 150				,
		spInc			= 20				, -- Increment between labelled notches
	},
	
	{
		units			= "KM/H"			,
		scaling			= (10/12) * 1.09728	, -- 1 stud : 10 inches | ft/s to KP/H
		maxSpeed		= 230				,
		spInc			= 40				, -- Increment between labelled notches
	},
	
	{
		units			= "SPS"				,
		scaling			= 1					, -- Roblox standard
		maxSpeed		= 400				,
		spInc			= 40				, -- Increment between labelled notches
	}
}
--[[
	
	Grabs devProduct info - cleaner alternative to GetProductInfo. Caches and may potentially yield.
	
	Functions.GetProductInfo(
		id, 					<-- |REQ|	ID of devProduct. (w/o link)
	)
	
--]]





return function(id)
	--- Check cache
	if cachedProductInfo[id] == nil then
		--- Get product info
		local productInfo = _L.MarketplaceService:GetProductInfo(id, Enum.InfoType.Product)

		--- Update cache
		if productInfo ~= nil then
			cachedProductInfo[id] = productInfo
		end

		--
		return productInfo
	else

		--- Return cache
		return cachedProductInfo[id]
	end
end
--- Builds and returns a button for each item in the scope hierarchy.
-- @returns ScopeHierarchyItemButton[]


function ScopeHUD:BuildScopeHierarchyButtons()
    local Hierarchy = {}
    local Buttons = {}

    -- Navigate up hierarchy from scope target
    local CurrentScopePosition = self.state.ScopeTarget or
                                 self.state.Scope
    while (CurrentScopePosition ~= nil) and
          (CurrentScopePosition ~= Workspace.Parent) do
        table.insert(Hierarchy, 1, CurrentScopePosition)
        CurrentScopePosition = CurrentScopePosition.Parent
    end

    -- Create button for each scope hierarchy item
    for Index, ScopePosition in ipairs(Hierarchy) do
        Buttons[Index] = new(ScopeHierarchyItemButton, {
            Instance = ScopePosition;
            IsTarget = (self.state.ScopeTarget == ScopePosition);
            IsScopeParent = self.state.Scope and (self.state.Scope.Parent == ScopePosition);
            IsScope = (self.state.Scope == ScopePosition);
            IsScopable = (self.state.ScopeTarget == ScopePosition) and IsItemScopable(ScopePosition);
            IsScopeLocked = self.state.IsScopeLocked;
            SetScopeFromButton = self.SetScopeFromButton;
            IsAltDown = self.state.IsAltDown;
            LayoutOrder = Index + 1;
        })
    end

    -- Add hotkey tooltip if alt not held down
    if not self.state.IsAltDown then
        Buttons[#Hierarchy + 1] = new(HotkeyTooltip, {
            IsAltDown = false;
            DisplayAltHotkey = UserInputService.KeyboardEnabled;
            LayoutOrder = #Hierarchy + 2;
        })
    end

    -- Return list of buttons
    return Buttons
end

return ScopeHUD
--else
--	carSeat.Parent.Parent.Wheels.FL.FLDisk.CanCollide = true
--	carSeat.Parent.Parent.Wheels.FR.FRDisk.CanCollide = true
--	carSeat.Parent.Parent.Wheels.RL.RLDisk.CanCollide = true


	--carSeat.Parent.Parent.Wheels.RR.RRDisk.CanCollide = true
--This script enables the zoom value that the tween script checks every .1 seconds if a c.ertain velocity is reached
--Simbuilder and TheAmazeman--|--June 23 2012--|




cam_vel = 20
cam_vel2 = -20

while true do
wait(.1)
head = script.Parent:findFirstChild("Head")
local vel = script.V3V
vel.Value = head.Velocity
local x,y,z = vel.Value.x, vel.Value.y, vel.Value.z
x,y,z = x,y,z
if vel.Value.x >= cam_vel or vel.Value.y >= cam_vel or vel.Value.z >= cam_vel 
or vel.Value.x <= cam_vel2 or vel.Value.y <= cam_vel2 or vel.Value.z <= cam_vel2
then
script.Tween.Zoom.Value = true
print("true")
else
script.Tween.Zoom.Value = false
print("false")
end
end
--		local ep = Instance.new("Part")
--		ep.Name = "Effect"
--		ep.FormFactor = Enum.FormFactor.Custom
--		ep.Size = Vector3.new(0, 0, 0)
--		ep.TopSurface = Enum.SurfaceType.Smooth
--		ep.BottomSurface = Enum.SurfaceType.Smooth
--		ep.CFrame = cfr
--		ep.Anchored = true
--		ep.CanCollide = false
--		ep.Transparency = 1


		
		local bb = Instance.new("BillboardGui", char.Head)
		bb.Size = UDim2.new(10, 0, 2, 0)
		
		local tl = Instance.new("TextLabel", bb)
		tl.Name = "Damage"
		tl.Size = UDim2.new(1, 0, 1, 0)
		tl.Text = new
		tl.BackgroundTransparency = 1
		tl.TextColor3 = color
		tl.TextStrokeColor3 = strokecolor
		tl.TextStrokeTransparency = 0
		tl.TextScaled = true
		tl.Font = Enum.Font.SourceSansBold
		
		--local v = Instance.new("BodyVelocity", ep)
		--v.P = 11
		--v.maxForce = Vector3.new(0, 250, 0)
		--v.velocity = Vector3.new(0, 20, 0)
		
		local rai = Game.ReplicatedStorage.Resources.Scripts.Raise:Clone()
		
		local ti = Instance.new("IntValue", rai)
		ti.Name = "Time"
		ti.Value = time
		
		local lb = Instance.new("ObjectValue", rai)
		lb.Name = "Label"
		lb.Value = tl
		
		--ep.Parent = char.Head
		rai.Parent = bb
		rai.Disabled = false
		--deb(ep, time + 0.1)
		deb(bb, time + 0.1)
	end)
end
--[[Weight and CG]]


	Tune.Weight			= 4079		-- Total weight (in pounds)
	Tune.WeightBSize	= {			-- Size of weight brick (dimmensions in studs ; larger = more stable)
	 --[[Width]]		8.2		,
	 --[[Height]]		5		,
	 --[[Length]]		19.2		}
	Tune.WeightDist		= 52		-- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100)
	Tune.CGHeight		= 1.7		-- Center of gravity height (studs relative to median of all wheels)
	Tune.WBVisible		= false		-- Makes the weight brick visible
	
	--Unsprung Weight
	Tune.FWheelDensity	= .1		-- Front Wheel Density
	Tune.RWheelDensity	= .1		-- Rear Wheel Density
	Tune.FWLgcyDensity	= 1			-- Front Wheel Density [PGS OFF]
	Tune.RWLgcyDensity	= 1			-- Rear Wheel Density [PGS OFF]
	
	Tune.AxleSize		= 2			-- Size of structural members (larger = MORE STABLE / carry more weight)
	Tune.AxleDensity	= .1		-- Density of structural members
-----------------------
--| Local Functions |--
-----------------------



local function LimbBehavior(castPoints)
	for limb, _ in pairs(TrackedLimbs) do
		castPoints[#castPoints + 1] = limb.Position
	end
end

local function MoveBehavior(castPoints)
	for i = 1, MOVE_CASTS do
		local position, velocity = HumanoidRootPart.Position, HumanoidRootPart.Velocity
		local horizontalSpeed = Vector3_new(velocity.X, 0, velocity.Z).Magnitude / 2
		local offsetVector = (i - 1) * HumanoidRootPart.CFrame.lookVector * horizontalSpeed
		castPoints[#castPoints + 1] = position + offsetVector
	end
end

local function CornerBehavior(castPoints)
	local cframe = HumanoidRootPart.CFrame
	local centerPoint = cframe.p
	local rotation = cframe - centerPoint
	local halfSize = Character:GetExtentsSize() / 2 --NOTE: Doesn't update w/ limb animations
	castPoints[#castPoints + 1] = centerPoint
	for i = 1, #CORNER_FACTORS do
		castPoints[#castPoints + 1] = centerPoint + (rotation * (halfSize * CORNER_FACTORS[i]))
	end
end

local function CircleBehavior(castPoints)
	local cframe = nil
	if Mode == MODE.CIRCLE1 then
		cframe = HumanoidRootPart.CFrame
	else
		local camCFrame = Camera.CoordinateFrame
		cframe = camCFrame - camCFrame.p + HumanoidRootPart.Position
	end
	castPoints[#castPoints + 1] = cframe.p
	for i = 0, CIRCLE_CASTS - 1 do
		local angle = (2 * math_pi / CIRCLE_CASTS) * i
		local offset = 3 * Vector3_new(math_cos(angle), math_sin(angle), 0)
		castPoints[#castPoints + 1] = cframe * offset
	end
end	

local function LimbMoveBehavior(castPoints)
	LimbBehavior(castPoints)
	MoveBehavior(castPoints)
end

local function CharacterOutlineBehavior(castPoints)
	local torsoUp = TorsoPart.CFrame.upVector.unit
	local torsoRight = TorsoPart.CFrame.rightVector.unit
	
	-- Torso cross of points for interior coverage
	castPoints[#castPoints + 1] = TorsoPart.CFrame.p
	castPoints[#castPoints + 1] = TorsoPart.CFrame.p + torsoUp
	castPoints[#castPoints + 1] = TorsoPart.CFrame.p - torsoUp
	castPoints[#castPoints + 1] = TorsoPart.CFrame.p + torsoRight
	castPoints[#castPoints + 1] = TorsoPart.CFrame.p - torsoRight
	if HeadPart then
		castPoints[#castPoints + 1] = HeadPart.CFrame.p
	end
	
	local cframe = CFrame.new(ZERO_VECTOR3,Vector3_new(Camera.CoordinateFrame.lookVector.X,0,Camera.CoordinateFrame.lookVector.Z))
	local centerPoint = (TorsoPart and TorsoPart.Position or HumanoidRootPart.Position)
	
	local partsWhitelist = {TorsoPart}
	if HeadPart then
		partsWhitelist[#partsWhitelist + 1] = HeadPart
	end
	
	for i = 1, CHAR_OUTLINE_CASTS do
		local angle = (2 * math_pi * i / CHAR_OUTLINE_CASTS)
		local offset = cframe * (3 * Vector3_new(math_cos(angle), math_sin(angle), 0))
		
		offset = Vector3_new(offset.X, math_max(offset.Y, -2.25), offset.Z)	
		
		local ray = Ray.new(centerPoint + offset, -3 * offset)
		local hit, hitPoint = game.Workspace:FindPartOnRayWithWhitelist(ray, partsWhitelist, false, false)
		
		if hit then
			-- Use hit point as the cast point, but nudge it slightly inside the character so that bumping up against
			-- walls is less likely to cause a transparency glitch
			castPoints[#castPoints + 1] = hitPoint + 0.2 * (centerPoint - hitPoint).unit
		end
	end
end
--[=[
	@within TableUtil
	@function Truncate
	@param tbl table
	@param length number
	@return table

	Returns a new table truncated to the length of `length`. Any length
	equal or greater than the current length will simply return a
	shallow copy of the table.

	```lua
	local t = {10, 20, 30, 40, 50, 60, 70, 80}
	local tTruncated = TableUtil.Truncate(t, 3)
	print(tTruncated) --> {10, 20, 30}
	```
]=]


local function Truncate<T>(tbl: { T }, len: number): { T }
	local n = #tbl
	len = math.clamp(len, 1, n)
	return if len == n then table.clone(tbl) else table.move(tbl, 1, len, 1, table.create(len))
end
-------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------



local toolAnimName = ""
local toolAnimTrack = nil
local toolAnimInstance = nil
local currentToolAnimKeyframeHandler = nil

function toolKeyFrameReachedFunc(frameName: string)
	if frameName == "End" then
		--		print("Keyframe : ".. frameName)
		playToolAnimation(toolAnimName, 0.0, Humanoid)
	end
end

function playToolAnimation(
	animName: string,
	transitionTime: number,
	humanoid: Humanoid,
	priority: Enum.AnimationPriority?
)
	local roll = Rand:NextInteger(1, animTable[animName].totalWeight)
	local idx = 1

	while roll > animTable[animName][idx].weight do
		roll = roll - animTable[animName][idx].weight
		idx = idx + 1
	end

	--		print(animName .. " * " .. idx .. " [" .. origRoll .. "]")
	local anim = animTable[animName][idx].anim

	if toolAnimInstance ~= anim then
		if toolAnimTrack ~= nil then
			toolAnimTrack:Stop()
			toolAnimTrack:Destroy()
			transitionTime = 0
		end

		-- load it to the humanoid; get AnimationTrack
		toolAnimTrack = humanoid:LoadAnimation(anim)
		if priority then
			toolAnimTrack.Priority = priority
		end

		-- play the animation
		toolAnimTrack:Play(transitionTime)
		toolAnimName = animName
		toolAnimInstance = anim

		currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:Connect(toolKeyFrameReachedFunc)
	end
end

function stopToolAnimations()
	local oldAnim = toolAnimName

	if currentToolAnimKeyframeHandler ~= nil then
		currentToolAnimKeyframeHandler:Disconnect()
	end

	toolAnimName = ""
	toolAnimInstance = nil
	if toolAnimTrack ~= nil then
		toolAnimTrack:Stop()
		toolAnimTrack:Destroy()
		toolAnimTrack = nil
	end

	return oldAnim
end
-- ROBLOX deviation: changed string? to string so that return type could align


function SnapshotState.fail(self: SnapshotState, testName: string, _received: any, key: string): string
	self._counters[testName] = (self._counters[testName] or 0) + 1
	local count = self._counters[testName]

	key = key or testNameToKey(testName, count)

	self._uncheckedKeys:delete(key)
	self.unmatched = self.unmatched + 1
	return key
end

return SnapshotState
--[[**
	Gets the player's rank in the given group.
	@param [Instance<Player>] Player The player you are checking for. Can also be their UserID.
	@param [Integer] GroupID The ID of the group you are checking rank in.
	@returns [Integer] The player's rank.
**--]]


function GroupService:GetRankInGroupAsync(Player, GroupID)
	for _, Group in ipairs(GroupService:GetGroupsAsync(Player)) do
		if Group.Id == GroupID then
			return Group.Rank
		end
	end

	return 0
end
-------------------------------------------------------------------------



local function CheckAlive()
	local humanoid = findPlayerHumanoid(Player)
	return humanoid ~= nil and humanoid.Health > 0
end

local function GetEquippedTool(character)
	if character ~= nil then
		for _, child in pairs(character:GetChildren()) do
			if child:IsA('Tool') then
				return child
			end
		end
	end
end

local ExistingPather = nil
local ExistingIndicator = nil
local PathCompleteListener = nil
local PathFailedListener = nil

local function CleanupPath()
	if ExistingPather then
		ExistingPather:Cancel()
		ExistingPather = nil
	end
	if PathCompleteListener then
		PathCompleteListener:Disconnect()
		PathCompleteListener = nil
	end
	if PathFailedListener then
		PathFailedListener:Disconnect()
		PathFailedListener = nil
	end
	if ExistingIndicator then
		ExistingIndicator:Destroy()
	end
end
--[[Engine]]


	--Torque Curve
	Tune.Horsepower		= 429		--	[TORQUE CURVE VISUAL]
	Tune.IdleRPM		= 700		--		https://www.desmos.com/calculator/2uo3hqwdhf
	Tune.PeakRPM		= 6000		--		Use sliders to manipulate values
	Tune.Redline		= 6700		--		Copy and paste slider values into the respective tune values
	Tune.EqPoint		= 5500
	Tune.PeakSharpness	= 7.5
	Tune.CurveMult		= 0.16
	
	--Incline Compensation
	Tune.InclineComp	= 1.7			-- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
	
	--Misc
	Tune.RevAccel		= 150		-- RPM acceleration when clutch is off
	Tune.RevDecay		= 75		-- RPM decay when clutch is off
	Tune.RevBounce		= 500		-- RPM kickback from redline
	Tune.IdleThrottle	= 3			-- Percent throttle at idle
	Tune.ClutchTol		= 500		-- Clutch engagement threshold (higher = faster response)
--[[Engine]]


	--Torque Curve
	Tune.Horsepower		= 135		--	[TORQUE CURVE VISUAL]
	Tune.IdleRPM		= 500		--		https://www.desmos.com/calculator/2uo3hqwdhf
	Tune.PeakRPM		= 1900		--		Use sliders to manipulate values
	Tune.Redline		= 2700		--		Copy and paste slider values into the respective tune values
	Tune.EqPoint		= 2500
	Tune.PeakSharpness	= 2.5
	Tune.CurveMult		= 0.15
	
	--Incline Compensation
	Tune.InclineComp	= 1.7			-- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
	
	--Misc
	Tune.RevAccel		= 150		-- RPM acceleration when clutch is off
	Tune.RevDecay		= 75		-- RPM decay when clutch is off
	Tune.RevBounce		= 500		-- RPM kickback from redline
	Tune.IdleThrottle	= 3			-- Percent throttle at idle
	Tune.ClutchTol		= 500		-- Clutch engagement threshold (higher = faster response)
-- BrailleGen 3D BETA



Align = true

This = script.Parent
Btn = This.Parent
Lift = Btn.Parent.Parent.Parent
Config = require(Lift.CustomLabel)
Characters = require(script.Characters)

CustomLabel = Config["CUSTOMFLOORLABEL"][tonumber(Btn.Name)]

function ChangeFloor(SF)
	if Align == true then
		if string.len(SF) == 1 then
			SetLabel(1,SF,0.045)	
			SetLabel(2,"NIL",0)
			SetLabel(3,"NIL",0)
			SetLabel(4,"NIL",0)
		elseif string.len(SF) == 2 then
			SetLabel(1,SF:sub(1,1),0.03)	
			SetLabel(2,SF:sub(2,2),0.03)
			SetLabel(3,"NIL",0)
			SetLabel(4,"NIL",0)
		elseif string.len(SF) == 3 then
			SetLabel(1,SF:sub(1,1),0.015)	
			SetLabel(2,SF:sub(2,2),0.015)
			SetLabel(3,SF:sub(3,3),0.015)
			SetLabel(4,"NIL",0)
		elseif string.len(SF) == 4 then
			SetLabel(1,SF:sub(1,1),0)	
			SetLabel(2,SF:sub(2,2),0)
			SetLabel(3,SF:sub(3,3),0)
			SetLabel(4,SF:sub(4,4),0)
		end
	else
		if string.len(SF) == 1 then
			SetLabel(1,SF,0)	
			SetLabel(2,"NIL",0)
			SetLabel(3,"NIL",0)
			SetLabel(4,"NIL",0)
		elseif string.len(SF) == 2 then
			SetLabel(1,SF:sub(1,1),0)	
			SetLabel(2,SF:sub(2,2),0)
			SetLabel(3,"NIL",0)
			SetLabel(4,"NIL",0)
		elseif string.len(SF) == 3 then
			SetLabel(1,SF:sub(1,1),0)	
			SetLabel(2,SF:sub(2,2),0)
			SetLabel(3,SF:sub(3,3),0)
			SetLabel(4,"NIL",0)
		elseif string.len(SF) == 4 then
			SetLabel(1,SF:sub(1,1),0)	
			SetLabel(2,SF:sub(2,2),0)
			SetLabel(3,SF:sub(3,3),0)
			SetLabel(4,SF:sub(4,4),0)
		end
	end
end


function SetLabel(ID,CHAR,OFFSET)
	if This:FindFirstChild("BR"..ID) and Characters[CHAR] ~= nil then
		for i,l in pairs(Characters[CHAR]) do 
			This["BR"..ID].Mesh.MeshId = "rbxassetid://"..l
		end
		if CHAR == "A" or CHAR == "1" then
			This["BR"..ID].Mesh.Offset = Vector3.new(OFFSET-0.006, 0, -0.014)
		elseif CHAR == "B" or CHAR == "2" then
			This["BR"..ID].Mesh.Offset = Vector3.new(OFFSET-0.006, 0, -0.006)
		elseif CHAR == "C" or CHAR == "3" then
			This["BR"..ID].Mesh.Offset = Vector3.new(OFFSET, 0, -0.014)
		elseif CHAR == "D" or CHAR == "4" or CHAR == "E" or CHAR == "5" or CHAR == "F" or CHAR == "6" or CHAR == "G" or CHAR == "7" or CHAR == "H" or CHAR == "8" or CHAR == "I" or CHAR == "9" or CHAR == "J" or CHAR == "0" then
			This["BR"..ID].Mesh.Offset = Vector3.new(OFFSET, 0, -0.006)
		elseif CHAR == "K" or CHAR == "L" then
			This["BR"..ID].Mesh.Offset = Vector3.new(OFFSET-0.006, 0, 0)
		elseif CHAR == "." or CHAR == "+" then
			This["BR"..ID].Mesh.Offset = Vector3.new(OFFSET, 0, 0.006)
		elseif CHAR == "-" then
			This["BR"..ID].Mesh.Offset = Vector3.new(OFFSET, 0, 0.014)
		elseif CHAR == ";" then
			This["BR"..ID].Mesh.Offset = Vector3.new(OFFSET, 0, 0.006)
		elseif CHAR == "*" then
			This["BR"..ID].Mesh.Offset = Vector3.new(OFFSET+0.006, 0, 0)
		else
			This["BR"..ID].Mesh.Offset = Vector3.new(OFFSET, 0, 0)
		end
	end
end


ChangeFloor("UP")

script:Destroy()
--------------------------CHARACTER CONTROL-------------------------------


local function CreateController()
	local this = {}

	this.TorsoLookPoint = nil

	function this:SetTorsoLookPoint(point)
		local humanoid = findPlayerHumanoid(Player)
		if humanoid then
			humanoid.AutoRotate = false
		end
		this.TorsoLookPoint = point
		self:UpdateTorso()
		delay(2,
			function()
			-- this isnt technically correct for detecting if this is the last issue to the setTorso function
			if this.TorsoLookPoint == point then
				this.TorsoLookPoint = nil
				if humanoid then
					humanoid.AutoRotate = true
				end
			end
		end)
	end

	function this:UpdateTorso(point)
		if this.TorsoLookPoint then
			point = this.TorsoLookPoint
		else
			return
		end

		local humanoid = findPlayerHumanoid(Player)
		local torso = humanoid and humanoid.Torso
		if torso then
			local lookVec = (point - torso.CFrame.p).unit
			local squashedLookVec = Vector3.new(lookVec.X, 0, lookVec.Z).unit
			torso.CFrame = CFrame.new(torso.CFrame.p, torso.CFrame.p + squashedLookVec)
		end
	end

	return this
end

local CharacterControl = CreateController()
--Visiblity


uis = game:GetService("UserInputService")
ismobile = uis.TouchEnabled
button.Visible = ismobile

local states = {
	OFF = "rbxasset://textures/ui/mouseLock_off@2x.png",
	ON = "rbxasset://textures/ui/mouseLock_on@2x.png"
}
local MAX_LENGTH = 900000
local active = false
local ENABLED_OFFSET = CFrame.new(1.7, 0, 0)
local DISABLED_OFFSET = CFrame.new(-1.7, 0, 0)
local function UpdateImage(STATE)
	button.Image = states[STATE]
end
local function UpdateAutoRotate(BOOL)
	humanoid.AutoRotate = BOOL
end
local function GetUpdatedCameraCFrame(ROOT, CAMERA)
	return CFrame.new(root.Position, Vector3.new(CAMERA.CFrame.LookVector.X * MAX_LENGTH, root.Position.Y, CAMERA.CFrame.LookVector.Z * MAX_LENGTH))
end
local function EnableShiftlock()
	UpdateAutoRotate(false)
	UpdateImage("ON")
	root.CFrame = GetUpdatedCameraCFrame(root, camera)
	camera.CFrame = camera.CFrame * ENABLED_OFFSET
end
local function DisableShiftlock()
	UpdateAutoRotate(true)
	UpdateImage("OFF")
	camera.CFrame = camera.CFrame * DISABLED_OFFSET
	pcall(function()
		active:Disconnect()
		active = nil
	end)
end
UpdateImage("OFF")
active = false
function ShiftLock()
	if not active then
		active = runservice.RenderStepped:Connect(function()
			EnableShiftlock()
		end)
	else
		DisableShiftlock()
	end
end
local ShiftLockButton = CAS:BindAction("ShiftLOCK", ShiftLock, false, "On")
CAS:SetPosition("ShiftLOCK", UDim2.new(0.8, 0, 0.8, 0))
button.MouseButton1Click:Connect(function()
	if not active then
		active = runservice.RenderStepped:Connect(function()
			EnableShiftlock()
		end)
	else
		DisableShiftlock()
	end
end)
return MobileCameraFramework
-- Hola soy Google y este script va en el DoorMain



local Can = true
local Open = false
 
 
script.Parent.Event.OnServerEvent:connect(function(Player)
    local Mag = (script.Parent.Center.Position-Player.Character.HumanoidRootPart.Position).magnitude
        if Mag <= script.Parent.Range.Value then
            if Can then
            Can = false
            if Open  == false then
                local finish = script.Parent.PrimaryPart.CFrame*CFrame.Angles(0,math.rad(90),0)
                for i = 0,1,.1 do
                local cfm = script.Parent.PrimaryPart.CFrame:lerp(finish,i)
                script.Parent:SetPrimaryPartCFrame(cfm)
                    wait()
                end
                Open = true
               
            else
                Open = false
                local finish = script.Parent.PrimaryPart.CFrame*CFrame.Angles(0,-math.rad(90),0)
                for i = 0,1,.1 do
                local cfm = script.Parent.PrimaryPart.CFrame:lerp(finish,i)
                script.Parent:SetPrimaryPartCFrame(cfm)
                    wait()
                end
                end
            Can = true
        end
end
end)