Pinkstack/roblox-luau-corpus-text huggingface dataset:
--[=[
	@return Trove
	Creates and adds another trove to itself. This is just shorthand
	for `trove:Construct(Trove)`. This is useful for contexts where
	the trove object is present, but the class itself isn't.

	:::note
	This does _not_ clone the trove. In other words, the objects in the
	trove are not given to the new constructed trove. This is simply to
	construct a new Trove and add it as an object to track.
	:::

	```lua
	local trove = Trove.new()
	local subTrove = trove:Extend()

	trove:Clean() -- Cleans up the subTrove too
	```
]=]


function Trove:Extend()
	return self:Construct(Trove)
end
-- RANK, RANK NAMES & SPECIFIC USERS


Ranks = {
	{5,	"Hotel Owner",		};
	{4,	"Hotel Manager",	{"",0},	};
	{3,	"Hotel Worker",		{"",0},	};
	{2,	"Hotel Helper",			{"",0},	};
	{1,	"Hotel Desk",			{"",0},	};
	{0,	"Hotel Guest",		};
};
--local cameraModule = playerModule:GetCameras()



local camera = workspace.CurrentCamera

local avatarEditorFrame = avatarEditorGui.Main
local catalogFrame = avatarEditorFrame.Catalog
local viewerFrame = avatarEditorFrame.Viewer

local detailsOverlay = avatarEditorGui.DetailsOverlay
local toggleButton = avatarEditorGui.Toggle

local doneButton = viewerFrame.Done
local viewButton = viewerFrame.View

local headerFrame = catalogFrame.Header
local categoryTabsFrame = headerFrame.CategoryTabs
local subCategoryTabsFrame = headerFrame.SubCategoryTabs
local searchFrame = headerFrame.Search

local containerFrame = catalogFrame.Container
local scrollingFrame = containerFrame.ScrollingFrame
local scrollingFrameUIGridLayout = scrollingFrame.UIGridLayout

local scaleFrame = containerFrame.ScaleFrame
local scaleFrameUIGridLayout = scaleFrame.UIGridLayout

local searchTextBox = searchFrame.TextBox
local clearSearchButton = searchFrame.Clear

local purchasePrompt = PurchasePrompt.new(detailsOverlay)

local activeButtons = Maid.new()
local activeConnections = Maid.new()
local activeCategoryButtons = {}
local activeSubCategoryButtons = {}

local numberValue = Instance.new("NumberValue")
numberValue.Value = CAMERA_OFFSET

local categoryButtons = TableUtil.Filter(categoryTabsFrame:GetChildren(), function(item)
	return item:IsA("GuiButton")
end)
local subCategoryFrames = TableUtil.Filter(subCategoryTabsFrame:GetChildren(), function(item)
	return item:IsA("GuiObject")
end)

local catalogFrameOpenTween = Tween:Create(catalogFrame, tweenInfo, {Position = UDim2.new(0, 0, 0, 0)})
local catalogFrameCloseTween = Tween:Create(catalogFrame, tweenInfo, {Position = UDim2.new(-0.6, 0, 0, 0)})
local viewerFrameOpenTween = Tween:Create(viewerFrame, tweenInfo, {Position = UDim2.new(1, 0, 0, 0)})
local viewerFrameCloseTween = Tween:Create(viewerFrame, tweenInfo, {Position = UDim2.new(1.4, 0, 0, 0)})
local viewFramePartialOpenTween = Tween:Create(viewerFrame, tweenInfo, {Position = UDim2.new(1.4, -36, 0, 0)})
local fullViewCloseTween = Tween:Create(numberValue, tweenInfo, {Value = CAMERA_OFFSET})
local fullViewOpenTween = Tween:Create(numberValue, tweenInfo, {Value = 0.5})

local currentCategory = "Accessories"
local currentSubCategory = "Hair"

local isOpen = false
local fullView = false
-- Game Mode Overrides


_overrides.DEFAULT = {
	game_mode_name = "DEFAULT",
	override = true,
}

_overrides.DEATHMATCH = {
	game_mode_name = "DEATHMATCH",
	override = true,

	respawn = true,
	respawnTime = 5,
	respawn_radius_lowest_fraction = 0.7, -- players will respawn between lowest_fraction and highest_fraction of target storm radius
	respawn_radius_highest_fraction = 0.9,
	respawn_height_fraction = 0.75, -- fraction of delivery_vehicle_spawn_height
	killsNeededToWin = 25,

	storm = {
		radius = 6000,
		time_before_start = 18,
		debug_time_scale = 1,
		number_of_stages = 5,

		-- stage 0 (show starting circle with no transition)
		{ transition_length = 0,
			wait_length = 210,
			damage = 1,
			move_scale = 0,
			shrinkage_factor = 0 },

		-- stage 1
		{ transition_length = 120,
			wait_length = 120,
			damage = 3,
			shrinkage_factor = 0.75 },

		-- stage 2
		{ transition_length = 90,
			wait_length = 90,
			damage = 5,
			shrinkage_factor = 0.3 },

		-- stage 3
		{ transition_length = 75,
			wait_length = 0,
			damage = 7,
			shrinkage_factor = 0.3 },

		-- stage 4 (wait indefinitely until match ends)
		{ transition_length = 0,
		wait_length = 1,
		damage = 10,
		shrinkage_factor = 0 },
	},
}

_overrides.TEAM_DEATHMATCH = {
	game_mode_name = "TEAM_DEATHMATCH",
	override = true,

	-- Respawn config values
	respawn = true,
	respawnTime = 5,
	respawn_radius_lowest_fraction = 0.7, -- players will respawn between lowest_fraction and highest_fraction of target storm radius
	respawn_radius_highest_fraction = 0.9,
	respawn_height_fraction = 0.75, -- fraction of delivery_vehicle_spawn_height

	-- Team config values
	num_teams = 2,
	team_names = {
		"Orange",
		"Blue",
	},
	team_colors = {
		Color3.fromRGB(255, 120, 0),
		Color3.fromRGB(0, 120, 255),
	},
	num_respawn_tickets = 15,
	delivery_vehicle_offset_from_center = 1800, --  delivery vehicle paths will be set this distance (in studs) from center dividing line

	storm = {
		radius = 6000,
		time_before_start = 18,
		debug_time_scale = 1,
		number_of_stages = 5,

		-- stage 0 (show starting circle with no transition)
		{ transition_length = 0,
			wait_length = 210,
			damage = 1,
			move_scale = 0,
			shrinkage_factor = 0 },

		-- stage 1
		{ transition_length = 120,
			wait_length = 120,
			damage = 3,
			shrinkage_factor = 0.75 },

		-- stage 2
		{ transition_length = 90,
			wait_length = 90,
			damage = 5,
			shrinkage_factor = 0.3 },

		-- stage 3
		{ transition_length = 75,
			wait_length = 0,
			damage = 7,
			shrinkage_factor = 0.3 },

		-- stage 4 (wait indefinitely until match ends)
		{ transition_length = 0,
		wait_length = 1,
		damage = 10,
		shrinkage_factor = 0 },
	},
}
--Actual script


game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function()
if script:FindFirstChild("SendDeathMessage") and script:FindFirstChild("DeathMessage") then
script:FindFirstChild("SendDeathMessage").Parent = game.ReplicatedStorage
script:FindFirstChild("DeathMessage").Parent = game.StarterGui
if player.Character:FindFirstChild("Humanoid") then
local hum = player.Character:FindFirstChild("Humanoid")
hum.Died:Connect(function()
local DeathMessage = DeathMessages[math.random(1,#DeathMessages)]
local Users = game.Players:GetChildren()
for i, User in pairs(Users) do
if game.ReplicatedStorage:FindFirstChild("SendDeathMessage") then
game.ReplicatedStorage.SendDeathMessage:InvokeClient(User, player.Name .. " " .. DeathMessage)
end
end
end)
end
elseif game.ReplicatedStorage:FindFirstChild("SendDeathMessage") and game.StarterGui:FindFirstChild("DeathMessage") then
if player.Character:FindFirstChild("Humanoid") then
local hum = player.Character:FindFirstChild("Humanoid")
hum.Died:Connect(function()
local DeathMessage = DeathMessages[math.random(1,#DeathMessages)]
local Users = game.Players:GetChildren()
for i, User in pairs(Users) do
if game.ReplicatedStorage:FindFirstChild("SendDeathMessage") then
game.ReplicatedStorage.SendDeathMessage:InvokeClient(User, player.Name .. " " .. DeathMessage)
end
end
end)
end	
end
end)
end)
--[[Susupension]]


	Tune.SusEnabled		= true		-- works only in with PGSPhysicsSolverEnabled, defaults to false when PGS is disabled
	
	--Front Suspension
	Tune.FSusDamping	= 500		-- Spring Dampening
	Tune.FSusStiffness	= 9000		-- Spring Force
	Tune.FSusLength		= 2			-- Suspension length (in studs)
	Tune.FSusMaxExt		= .2		-- Max Extension Travel (in studs)
	Tune.FSusMaxComp	= .2		-- Max Compression Travel (in studs)
	Tune.FSusAngle		= 80		-- Suspension Angle (degrees from horizontal)
		
	Tune.FWsBoneLen		= 5			-- Wishbone Length
	Tune.FWsBoneAngle	= 0			-- Wishbone angle (degrees from horizontal)
	Tune.FAnchorOffset	= {			-- Suspension anchor point offset (relative to center of wheel)
	 --[[Lateral]]		-.4		,	-- positive = outward
	 --[[Vertical]]		-.5		,	-- positive = upward
	 --[[Forward]]		0		}	-- positive = forward
	
	--Rear Suspension
	Tune.RSusDamping	= 500		-- Spring Dampening
	Tune.RSusStiffness	= 9000		-- Spring Force
	Tune.RSusLength		= 2			-- Suspension length (in studs)
	Tune.RSusMaxExt		= .2		-- Max Extension Travel (in studs)
	Tune.RSusMaxComp	= .2		-- Max Compression Travel (in studs)
	Tune.RSusAngle		= 80		-- Suspension Angle (degrees from horizontal)
		
	Tune.RWsBoneLen		= 5			-- Wishbone Length
	Tune.RWsBoneAngle	= 0			-- Wishbone angle (degrees from horizontal)
	Tune.RAnchorOffset	= {			-- Suspension anchor point offset (relative to center of wheel)
	 --[[Lateral]]		-.4		,	-- positive = outward
	 --[[Vertical]]		-.5		,	-- positive = upward
	 --[[Forward]]		0		}	-- positive = forward

	--Aesthetics	
	Tune.SusVisible		= false			-- Spring Visible
	Tune.WsBVisible		= false			-- Wishbone Visible
	Tune.SusRadius		= .2			-- Suspension Coil Radius
	Tune.SusThickness	= .1			-- Suspension Coil Thickness
	Tune.SusColor		= "Really black"	-- Suspension Color [BrickColor]
	Tune.SusCoilCount	= 6				-- Suspension Coil Count
	Tune.WsColor		= "Black"		-- Wishbone Color [BrickColor]
	Tune.WsThickness	= .1			-- Wishbone Rod Thickness
--[=[
	Flattens all the brios in one brio and combines them, and then switches it to
	a brio so only the last state is valid.

	@param observables { [any]: Observable<Brio<T>> | Observable<T> | T }
	@param filter function | nil
	@return Observable<Brio<{ [any]: T }>>
]=]


function RxBrioUtils.flatCombineLatestBrio(observables, filter)
	assert(type(observables) == "table", "Bad observables")

	return RxBrioUtils.flatCombineLatest(observables)
		:Pipe({
			RxBrioUtils.switchToBrio();
			filter and RxBrioUtils.where(filter) or nil
		})
end
--[[
	ROBLOX deviation: ReactSharedInternals captures singleton state across the
	whole workspace. This file and the modules it requires were moved from React
	to untangle a cyclic workspace member dependency.

	Before:
	* ReactSharedInternals (and the 5 associated modules) lived in React
	* React had a dependency on Shared
	* Shared reached into React source to re-export ReactSharedInternals (cycle)

	After:
	* ReactSharedInternals (and the 5 associated modules) live in Shared
	* React depends on Shared
	* Shared has no intra-workspace dependencies (no cycles)
]]


local Packages = script.Parent.Parent
local console = require(Packages.LuauPolyfill).console
local function onlyInTestError(functionName: string)
	return function()
		console.error(functionName .. " is only available in tests, not in production")
	end
end
--		print("Wha " .. pose)


		stopAllAnimations()
		amplitude = 0.1
		frequency = 1
		setAngles = true
	end

	if (setAngles) then
		desiredAngle = amplitude * math.sin(time * frequency)

		RightShoulder:SetDesiredAngle(desiredAngle + climbFudge)
		LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge)
		RightHip:SetDesiredAngle(-desiredAngle)
		LeftHip:SetDesiredAngle(-desiredAngle)
	end

	-- Tool Animation handling
	local tool = getTool()
	if tool then
	
		animStringValueObject = getToolAnim(tool)

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

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

		animateTool()		
	else
		stopToolAnimations()
		toolAnim = "None"
		toolAnimInstance = nil
		toolAnimTime = 0
	end
end
-- REQUIRED PARTS -----------------------------------------------
-- Include all of these, or things will break!


local headlights = {
	model.Headlight_Left,
	model.Headlight_Right
}
local brakelights = {
	model.Brakelight_Left,
	model.Brakelight_Right
}
local seat = model.VehicleSeat -- Your driver seat
local upVectorPart = model.VehicleSeatBack -- Any part with lookvector up (we use this when you get flipped over)
local gyro = upVectorPart.BodyGyro  -- Point this to any unused bodyGyro.
local smoke = model.ExhaustPipe.Smoke
local fire = model.ExhaustPipe.Fire
-- Requires - Module Functions


ServerSceneFramework.LoadCharacterRemoteEventModule = require(script.LoadCharacterRemoteEventModule)
ServerSceneFramework.LoadSceneModule = require(script.LoadSceneModule)
ServerSceneFramework.FinishedLoadingClientModule = require(script.FinishedLoadingClientModule)
ServerSceneFramework.LoadSceneFromListEventModule = require(script.LoadSceneFromListEventModule)
ServerSceneFramework.GetCurrentSceneEnvironmentModule = require(script.GetCurrentSceneEnvironmentModule)
ServerSceneFramework.IsLoadingSceneModule = require(script.IsLoadingSceneModule)
ServerSceneFramework.LoadSceneServerModule = require(script.LoadSceneServerModule)
ServerSceneFramework.OnPlayerAddedModule = require(script.OnPlayerAddedModule)
ServerSceneFramework.CheckFolderForLoadedScenesModule = require(script.CheckFolderForLoadedScenesModule)
ServerSceneFramework.FindClientFolderModule = require(script.FindClientFolderModule)
ServerSceneFramework.FindServerFolderModule = require(script.FindServerFolderModule)
ServerSceneFramework.InitModule = require(script.InitModule)
ServerSceneFramework.HandleOrchestrateEvent = require(script.HandleOrchestrateEvent)

local Orchestra = script.Parent
--	[TORQUE CURVE VISUAL]


	Tune.IdleRPM		= 1000		--		https://www.desmos.com/calculator/2uo3hqwdhf
	Tune.PeakRPM		= 6200		--		Use sliders to manipulate values
	Tune.Redline		= 7700		--		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)
--[[**
	Returns a t.union of each key in the table as a t.literal

	@param keyTable The table to get keys from

	@returns True iff the condition is satisfied, false otherwise
**--]]


function t.keyOf(keyTable)
	local keys = {}
	local length = 0
	for key in keyTable do
		length = length + 1
		keys[length] = key
	end

	return t.literal(table.unpack(keys, 1, length))
end
--[=[
	@param data table
	@return Option
	Deserializes the data into an Option. This data should have come from
	the `option:Serialize()` method.
]=]


function Option.Deserialize(data) -- type data = {ClassName: string, Value: any}
	assert(type(data) == "table" and data.ClassName == CLASSNAME, "Invalid data for deserializing Option")
	return data.Value == nil and Option.None or Option.Some(data.Value)
end
--bp.Position = shelly.PrimaryPart.Position


if not shellyGood then bp.Parent,bg.Parent= nil,nil return end
bp.Parent = nil
wait(math.random(3,8))
end


local soundBank = game.ReplicatedStorage.Sounds.NPC.Shelly:GetChildren()

shelly.Health.Changed:connect(function()
if shellyGood then
bp.Parent,bg.Parent= nil,nil
shelly.PrimaryPart.Transparency =1
shelly.PrimaryPart.CanCollide = false
shelly.Shell.Transparency = 1
shelly.HitShell.Transparency = 0
shelly.HitShell.CanCollide = true
shellyGood = false
ostrich = tick()
shelly:SetPrimaryPartCFrame(shelly.PrimaryPart.CFrame*CFrame.new(0,2,0))
local hitSound = soundBank[math.random(1,#soundBank)]:Clone()
hitSound.PlayOnRemove = true
hitSound.Parent = shelly.PrimaryPart
wait()
hitSound:Destroy()

repeat task.wait() until tick()-ostrich > 10
shelly.PrimaryPart.Transparency = 0
shelly.PrimaryPart.CanCollide = true
shelly.Shell.Transparency = 0
shelly.HitShell.Transparency = 1
shelly.HitShell.CanCollide = false
bp.Parent,bg.Parent = shelly.PrimaryPart,shelly.PrimaryPart
shellyGood = true
end
end)


while true do
if shellyGood then
MoveShelly()
else
task.wait(1)
end 
end
-- Do not edit these values, they are not the developer-set limits, they are limits
-- to the values the camera system equations can correctly handle


local MIN_ALLOWED_ELEVATION_DEG = -80
local MAX_ALLOWED_ELEVATION_DEG = 80

local externalProperties = {}
externalProperties["InitialDistance"] 	= 25
externalProperties["MinDistance"] 		= 10
externalProperties["MaxDistance"] 		= 100
externalProperties["InitialElevation"] 	= 35
externalProperties["MinElevation"] 		= 35
externalProperties["MaxElevation"] 		= 35
externalProperties["ReferenceAzimuth"] 	= -45	-- Angle around the Y axis where the camera starts. -45 offsets the camera in the -X and +Z directions equally
externalProperties["CWAzimuthTravel"] 	= 90	-- How many degrees the camera is allowed to rotate from the reference position, CW as seen from above
externalProperties["CCWAzimuthTravel"] 	= 90	-- How many degrees the camera is allowed to rotate from the reference position, CCW as seen from above
externalProperties["UseAzimuthLimits"] 	= false -- Full rotation around Y axis available by default

local Util = require(script.Parent:WaitForChild("CameraUtils"))
-- ================================================================================
-- Settings - Tachyon
-- ================================================================================



local Settings = {}

Settings.DefaultSpeed = 200		-- Speed when not boosted [Studs/second, Range 50-300]
Settings.BoostSpeed = 300		-- Speed when boosted [Studs/second, Maximum: 400]
Settings.BoostAmount = 6		-- Duration of boost in seconds
Settings.Steering = 8			-- How quickly the speeder turns [Range: 1-10]
--[[
	Constructs a new Promise with the given initializing callback.

	This is generally only called when directly wrapping a non-promise API into
	a promise-based version.

	The callback will receive 'resolve' and 'reject' methods, used to start
	invoking the promise chain.

	Second parameter, parent, is used internally for tracking the "parent" in a
	promise chain. External code shouldn't need to worry about this.
]]


function Promise._new(traceback, callback, parent)
	if parent ~= nil and not Promise.is(parent) then
		error("Argument #2 to Promise.new must be a promise or nil", 2)
	end

	local self = {
		-- Used to locate where a promise was created
		_source = traceback,

		_status = Promise.Status.Started,

		-- A table containing a list of all results, whether success or failure.
		-- Only valid if _status is set to something besides Started
		_values = nil,

		-- Lua doesn't like sparse arrays very much, so we explicitly store the
		-- length of _values to handle middle nils.
		_valuesLength = -1,

		-- Tracks if this Promise has no error observers..
		_unhandledRejection = true,

		-- Queues representing functions we should invoke when we update!
		_queuedResolve = {},
		_queuedReject = {},
		_queuedFinally = {},

		-- The function to run when/if this promise is cancelled.
		_cancellationHook = nil,

		-- The "parent" of this promise in a promise chain. Required for
		-- cancellation propagation upstream.
		_parent = parent,

		-- Consumers are Promises that have chained onto this one.
		-- We track them for cancellation propagation downstream.
		_consumers = setmetatable({}, MODE_KEY_METATABLE),
	}

	if parent and parent._status == Promise.Status.Started then
		parent._consumers[self] = true
	end

	setmetatable(self, Promise)

	local function resolve(...)
		self:_resolve(...)
	end

	local function reject(...)
		self:_reject(...)
	end

	local function onCancel(cancellationHook)
		if cancellationHook then
			if self._status == Promise.Status.Cancelled then
				cancellationHook()
			else
				self._cancellationHook = cancellationHook
			end
		end

		return self._status == Promise.Status.Cancelled
	end

	coroutine.wrap(function()
		local ok, _, result = runExecutor(
			self._source,
			callback,
			resolve,
			reject,
			onCancel
		)

		if not ok then
			reject(result[1])
		end
	end)()

	return self
end

function Promise.new(executor)
	return Promise._new(debug.traceback(nil, 2), executor)
end

function Promise:__tostring()
	return string.format("Promise(%s)", self._status)
end
--script.Parent.KK.Velocity = script.Parent.KK.CFrame.lookVector *script.Parent.Speed.Value
--script.Parent.KKK.Velocity = script.Parent.KKK.CFrame.lookVector *script.Parent.Speed.Value


script.Parent.KKKK.Velocity = script.Parent.KKKK.CFrame.lookVector *script.Parent.Speed.Value
script.Parent.L.Velocity = script.Parent.L.CFrame.lookVector *script.Parent.Speed.Value
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------




function Scale()
	local magnitude = GrabMagnitude()
	
	--- Don't run this if we don't need to (resolution hasn't changed much)
	if (not magnitude) or (lastMagnitude and math.abs(lastMagnitude - magnitude) < differenceToScan) or (lastMagnitude and lastMagnitude >= bestResolution and magnitude >= bestResolution) then
		return
	end
	lastMagnitude = magnitude
	
	--- Calculate ratio
	local ratio = maxDownscale + ((math.min(magnitude, bestResolution) / bestResolution) * (1 - maxDownscale))
	
	
	--- Change 9Slices
	for _, gui in ipairs(_L.Player.Get("PlayerGui"):GetChildren()) do
		if gui.ClassName == "ScreenGui" and (not _L.Functions.SearchArray(blacklist, gui.Name)) then
			for i, v in ipairs(gui:GetDescendants()) do
				--- Yield to prevent microstuttering for lots of gui elements
				if i%200 == 0 then
					wait()
				end
				
				--- Adjust 9slice scaling ratio based on resolution
				if (v.ClassName == "ImageLabel" or v.ClassName == "ImageButton") and v.ScaleType == Enum.ScaleType.Slice then
					if not archive[v] then
						archive[v] = v.SliceScale
					end
					local base = archive[v]
					v.SliceScale = base * ratio
				end
			end
		end
	end
end


function GrabMagnitude()
	local resolution = _L.Player.Get("Camera").ViewportSize
	if resolution then
		local magnitude = resolution.Magnitude
		return magnitude
	end
end
--This is just some simple server script that moves the object around every frame
--The kinematics module handles the rest




game["Run Service"].Heartbeat:Connect(function(deltaTime)
	
	local speed = script:GetAttribute("speed") or Vector3.zero
	total+=deltaTime
	part.CFrame = startPos * CFrame.fromEulerAngles(total*speed.x,total*speed.y,total*speed.z)
end)
-- ROBLOX deviation: we change from backtick to our literal string delimiter [=[ and ]=]


local function printBacktickString(str: string): string
	return "[=[\n" .. str .. "]=]"
end

local function ensureDirectoryExists(filePath: string)
	-- ROBLOX deviation: gets path of parent directory, GetScriptFilePath can only be called on ModuleScripts
	local pathComponents = filePath:split("/")
	pathComponents = table.pack(table.unpack(pathComponents, 1, #pathComponents - 1))
	local path = table.concat(pathComponents, "/")
	local ok, err = pcall(function()
		if not FileSystemService:Exists(path) then
			FileSystemService:CreateDirectories(path)
		end
	end)

	if not ok and err:find("Error%(13%): Access Denied%. Path is outside of sandbox%.") then
		error(
			"Provided path is invalid: you likely need to provide a different argument to --fs.readwrite.\n"
				.. "You may need to pass in `--fs.readwrite=$PWD`"
		)
	end
end

function normalizeNewLines(string_: string)
	string_ = string.gsub(string_, "\r\n", "\n")
	local result = string.gsub(string_, "\r", "\n")
	return result
end
-- wrapping long conditional in function


local function isShiftLockMode()
	return LocalPlayer.DevEnableMouseLock and GameSettings.ControlMode == Enum.ControlMode.MouseLockSwitch and
			LocalPlayer.DevComputerMovementMode ~= Enum.DevComputerMovementMode.ClickToMove and
			GameSettings.ComputerMovementMode ~= Enum.ComputerMovementMode.ClickToMove and
			LocalPlayer.DevComputerMovementMode ~= Enum.DevComputerMovementMode.Scriptable and
			not UserInputService.GamepadEnabled
end

if not UserInputService.TouchEnabled then	-- TODO: Remove when safe on mobile
	IsShiftLockMode = isShiftLockMode()
end