Roblox/luau_corpus huggingface dataset:
-- functions

function stopAllAnimations()
	local oldAnim = currentAnim

	-- return to idle if finishing an emote
	if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
		oldAnim = "idle"
	end
	
	if FFlagAnimateScriptEmoteHook and currentlyPlayingEmote then
		oldAnim = "idle"
		currentlyPlayingEmote = false
	end

	currentAnim = ""
	currentAnimInstance = nil
	if (currentAnimKeyframeHandler ~= nil) then
		currentAnimKeyframeHandler:disconnect()
	end

	if (currentAnimTrack ~= nil) then
		currentAnimTrack:Stop()
		currentAnimTrack:Destroy()
		currentAnimTrack = nil
	end

	-- clean up walk if there is one
	doForAllRunTracks(function(trackRec, name)
		if trackRec.handler ~= nil then
			trackRec.handler:disconnect()
		end					
	end)

	doForAllRunTracks(function(trackRec, name)
		if (trackRec.track ~= nil) then
			trackRec.track:Stop()
			trackRec.track:Destroy()
			trackRec.track = nil
		end		
	end)
	
	return oldAnim
end

function getHeightScale()
	if Humanoid then
		if not Humanoid.AutomaticScalingEnabled then
			return 1
		end
		
		local scale = Humanoid.HipHeight / HumanoidHipHeight
		if userAnimationSpeedDampening then
			if AnimationSpeedDampeningObject == nil then
				AnimationSpeedDampeningObject = script:FindFirstChild("ScaleDampeningPercent")
			end
			if AnimationSpeedDampeningObject ~= nil then
				scale = 1 + (Humanoid.HipHeight - HumanoidHipHeight) * AnimationSpeedDampeningObject.Value / HumanoidHipHeight
			end
		end
		return scale
	end	
	return 1
end
-- http://qaru.site/questions/11544765/roblox-rotating-a-model

local par=original.Parent -- сохраняем привязку 
original.Parent=game.ReplicatedStorage -- прячем оригинал
wait(3)

local dist = 45 -- растояние от центра
local angle = 30 -- угол разброса (чтобы 360 нацело делилось!!!)
--CONFIG
local pathWd = 40

local wallHt = 40
local wallThick = 1

local floorHt = 1

local cols = 15
local rows = 15
--[ Functions ]--
function CreateWeld(Part, CF)
	local w = Instance.new("Weld")
	w.Name = "LegWeld"
	w.Parent = Torso
	w.Part0 = Torso
	w.Part1 = Part
	w.C1 = CF
end

function StandUp()
	-- Right Leg
	RH.Part1 = RL

	-- Left Leg
	LH.Part1 = LL

	-- Delete Welds
	for i, s in pairs(Torso:GetChildren()) do
		if (s.Name == "LegWeld") and (s.ClassName == "Weld") then
			s:Destroy()
		end
	end

	-- Raise Character
	RJ.C0 = CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0)
	RJ.C1 = CFrame.new(0, 0, 0) * CFrame.Angles(0, 0, 0)
end
-- (Hat Giver Script - Loaded.)

debounce = true

function onTouched(hit)
	if (hit.Parent:findFirstChild("Humanoid") ~= nil and debounce == true) then
		debounce = false
		h = Instance.new("Hat")
		p = Instance.new("Part")
		h.Name = "BlueWinterCap"
		p.Parent = h
		p.Position = hit.Parent:findFirstChild("Head").Position
		p.Name = "Handle" 
		p.formFactor = 0
		p.Size = Vector3.new(0,-0.25,0) 
		p.BottomSurface = 0 
		p.TopSurface = 0 
		p.Locked = true 
		script.Parent.Mesh:clone().Parent = p
		h.Parent = hit.Parent
		h.AttachmentPos = Vector3.new(0, 0.4, -0.1)
		h.AttachmentRight = Vector3.new(1, 0, 0)
		h.AttachmentUp = Vector3.new(0, 0.995, -0.0995)
		h.AttachmentForward = Vector3.new(-0, -0.0995, -0.995)
		wait(5)
		debounce = true
	end
end

script.Parent.Touched:connect(onTouched)
--[[



]]

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local AvatarEditor = ReplicatedStorage.AvatarEditor
local Spring = require(AvatarEditor.Shared.Util.Spring)
local Maid = require(AvatarEditor.Shared.Util.Maid)
local Settings = require(AvatarEditor.Shared.Settings)
local Theme = require(AvatarEditor.Client.Theme)

local Class = {}
Class.__index = Class


function Class.new(guiButton, callback)
	local self = setmetatable({}, Class)
	
	self.Button = guiButton
	
	self.ColorSpring = Spring.new(0)
	self.ColorSpring.Damper = 1
	self.ColorSpring.Speed = 20
	
	self.Maid = Maid.new()
	
	self.Maid:GiveTask(guiButton.InputBegan:Connect(function(inputObject)
		if not Settings.HOVER_INPUTS[inputObject.UserInputType] then
			return
		end
		guiButton.MaxVisibleGraphemes = -1
		guiButton.Icon.Visible = false
	end))
	
	self.Maid:GiveTask(guiButton.InputEnded:Connect(function(inputObject)
		if not Settings.HOVER_INPUTS[inputObject.UserInputType] then
			return
		end
		guiButton.MaxVisibleGraphemes = 0
		guiButton.Icon.Visible = true
	end))
	
	self.Maid:GiveTask(guiButton.Activated:Connect(callback))
	
	return self
end


function Class:OnRenderStep(delta)
	local colorSpring = self.ColorSpring
	local button = self.Button
	
	colorSpring:TimeSkip(delta)
	
	local pos = colorSpring.Position
	local color = Theme:GetColor("Deselected"):lerp(Theme:GetColor("Selected"), pos)
	button.Icon.ImageColor3 = color
	button.TextColor3 = color
end


function Class:Destroy()
	self.Maid:DoCleaning()
	self.Maid = nil
	
	self.Button = nil
	self.ColorSpring = nil
	
	setmetatable(self, nil)
end


return Class
--Scripted by DermonDarble

local car = script.Parent
local stats = car.Configurations
local Raycast = require(script.RaycastModule)

local mass = 0

for i, v in pairs(car:GetChildren()) do
	if v:IsA("BasePart") then
		mass = mass + (v:GetMass() * 196.2)
	end
end

local bodyPosition = Instance.new("BodyPosition", car.Chassis)
bodyPosition.MaxForce = Vector3.new()
local bodyGyro = Instance.new("BodyGyro", car.Chassis)
bodyGyro.MaxTorque = Vector3.new()

local function UpdateThruster(thruster)
	-- Raycasting
	local hit, position = Raycast.new(thruster.Position, thruster.CFrame:vectorToWorldSpace(Vector3.new(0, -1, 0)) * stats.Height.Value) --game.Workspace:FindPartOnRay(ray, car)
	local thrusterHeight = (position - thruster.Position).magnitude

	-- Wheel
	local wheelWeld = thruster:FindFirstChild("WheelWeld")
	wheelWeld.C0 = CFrame.new(0, -math.min(thrusterHeight, stats.Height.Value * 0.8) + (wheelWeld.Part1.Size.Y / 2), 0)
	-- Wheel turning
	local offset = car.Chassis.CFrame:inverse() * thruster.CFrame
	local speed = car.Chassis.CFrame:vectorToObjectSpace(car.Chassis.Velocity)
	if offset.Z < 0 then
		local direction = 1
		if speed.Z > 0 then
			direction = -1
		end
		wheelWeld.C0 = wheelWeld.C0 * CFrame.Angles(0, (car.Chassis.RotVelocity.Y / 2) * direction, 0)
	end

	-- Particles
	if hit and thruster.Velocity.magnitude >= 5 then
		wheelWeld.Part1.ParticleEmitter.Enabled = true
	else
		wheelWeld.Part1.ParticleEmitter.Enabled = false
	end
end

car.DriveSeat.Changed:connect(function(property)
	if property == "Occupant" then
		if car.DriveSeat.Occupant then
			local player = game.Players:GetPlayerFromCharacter(car.DriveSeat.Occupant.Parent)
			if player then
				car.DriveSeat:SetNetworkOwner(player)
				local localCarScript = script.LocalCarScript:Clone()
				localCarScript.Parent = player.PlayerGui
				localCarScript.Car.Value = car
				localCarScript.Disabled = false
			end
		end
	end
end)

spawn(function()
	while true do
		game:GetService("RunService").Stepped:wait()
		for i, part in pairs(car:GetChildren()) do
			if part.Name == "Thruster" then
				UpdateThruster(part)
			end
		end
		if car.DriveSeat.Occupant then
			bodyPosition.MaxForce = Vector3.new()
			bodyGyro.MaxTorque = Vector3.new()
		else
			local hit, position, normal = Raycast.new(car.Chassis.Position, car.Chassis.CFrame:vectorToWorldSpace(Vector3.new(0, -1, 0)) * stats.Height.Value)
			if hit and hit.CanCollide then
				bodyPosition.MaxForce = Vector3.new(mass / 5, math.huge, mass / 5)
				bodyPosition.Position = (CFrame.new(position, position + normal) * CFrame.new(0, 0, -stats.Height.Value + 0.5)).p
				bodyGyro.MaxTorque = Vector3.new(math.huge, 0, math.huge)
				bodyGyro.CFrame = CFrame.new(position, position + normal) * CFrame.Angles(-math.pi/2, 0, 0)
			else
				bodyPosition.MaxForce = Vector3.new()
				bodyGyro.MaxTorque = Vector3.new()
			end
		end
	end
end)
----------------------------------------------------------------------------------------------------
-----------------=[ RECOIL & PRECISAO ]=------------------------------------------------------------
----------------------------------------------------------------------------------------------------
	,VRecoil = {14,18}				--- Vertical Recoil
	,HRecoil = {9,12}				--- Horizontal Recoil
	,AimRecover = .65				---- Between 0 & 1
	
	,RecoilPunch = .15
	,VPunchBase = 2.55				--- Vertical Punch
	,HPunchBase = 1.6				--- Horizontal Punch
	,DPunchBase = 1 				--- Tilt Punch | useless
	
	,AimRecoilReduction = 5 		--- Recoil Reduction Factor While Aiming (Do not set to 0)
	,PunchRecover = 0.2
	,MinRecoilPower = .5
	,MaxRecoilPower = 3
	,RecoilPowerStepAmount = .25
	
	,MinSpread = 0.95				--- Min bullet spread value | Studs
	,MaxSpread = 47					--- Max bullet spread value | Studs
	,AimInaccuracyStepAmount = .75
	,WalkMultiplier = 0				--- Bullet spread based on player speed

	,SwayBase = 0.05				--- Weapon Base Sway | Studs
	,MaxSway =	1.5					--- Max sway value based on player stamina | Studs
-- Images
local DEFAULT_IMAGE = "rbxassetid://5131576693"
local MOBILE_IMAGE = "rbxassetid://5131576829"
local CONSOLE_IMAGE = "rbxassetid://5131577063"
-- services

local TweenService	= game:GetService("TweenService")
local Workspace		= game:GetService("Workspace")
local Debris		= game:GetService("Debris")
-- If an expire time was provided, this message is displayed.
-- %TIME% is replaced with a string such as "23 hours, 30 minutes" 
local MESSAGE_BAN = "You are banned for %TIME%."
-- Sounds
local footstepsSound = rootPart:WaitForChild("Footsteps")
-- Create component
local LoadingSpinner = Roact.PureComponent:extend 'LoadingSpinner'

function LoadingSpinner:init()
    self.instance = Roact.createRef()
end

function LoadingSpinner:didMount()
    coroutine.wrap(function ()
        self.Running = true
        while self.Running and self.instance.current do
            local Spinner = self.instance.current
            Spinner.Rotation = (Spinner.Rotation + 12) % 360
            wait(0.01)
        end
    end)()
end

function LoadingSpinner:willUnmount()
    self.Running = nil
end

function LoadingSpinner:render()

    -- Prepare props
    local props = Support.Merge({}, self.props or {}, {
        [Roact.Ref] = self.instance,
        Image = 'rbxassetid://1932255814',
        AspectRatio = 1
    })

    -- Display component in wrapper
    return new(ImageLabel, props)

end

return LoadingSpinner
--[[--------------------------------------------------------------------
-- Notes:
-- * intended to 'imitate' llex.c code; performance is not a concern
-- * tokens are strings; code structure largely retained
-- * deleted stuff (compared to llex.c) are noted, comments retained
-- * nextc() returns the currently read character to simplify coding
--   here; next() in llex.c does not return anything
-- * compatibility code is marked with "--#" comments
--
-- Added:
-- * luaX:chunkid (function luaO_chunkid from lobject.c)
-- * luaX:str2d (function luaO_str2d from lobject.c)
-- * luaX.LUA_QS used in luaX:lexerror (from luaconf.h)
-- * luaX.LUA_COMPAT_LSTR in luaX:read_long_string (from luaconf.h)
-- * luaX.MAX_INT used in luaX:inclinenumber (from llimits.h)
--
-- To use the lexer:
-- (1) luaX:init() to initialize the lexer
-- (2) luaX:setinput() to set the input stream to lex
-- (3) call luaX:next() or luaX:luaX:lookahead() to get tokens,
--     until "TK_EOS": luaX:next()
-- * since EOZ is returned as a string, be careful when regexp testing
--
-- Not implemented:
-- * luaX_newstring: not required by this Lua implementation
-- * buffer MAX_SIZET size limit (from llimits.h) test not implemented
--   in the interest of performance
-- * locale-aware number handling is largely redundant as Lua's
--   tonumber() function is already capable of this
--
-- Changed in 5.1.x:
-- * TK_NAME token order moved down
-- * string representation for TK_NAME, TK_NUMBER, TK_STRING changed
-- * token struct renamed to lower case (LS -> ls)
-- * LexState struct: removed nestlevel, added decpoint
-- * error message functions have been greatly simplified
-- * token2string renamed to luaX_tokens, exposed in llex.h
-- * lexer now handles all kinds of newlines, including CRLF
-- * shbang first line handling removed from luaX:setinput;
--   it is now done in lauxlib.c (luaL_loadfile)
-- * next(ls) macro renamed to nextc(ls) due to new luaX_next function
-- * EXTRABUFF and MAXNOCHECK removed due to lexer changes
-- * checkbuffer(ls, len) macro deleted
-- * luaX:read_numeral now has 3 support functions: luaX:trydecpoint,
--   luaX:buffreplace and (luaO_str2d from lobject.c) luaX:str2d
-- * luaX:read_numeral is now more promiscuous in slurping characters;
--   hexadecimal numbers was added, locale-aware decimal points too
-- * luaX:skip_sep is new; used by luaX:read_long_string
-- * luaX:read_long_string handles new-style long blocks, with some
--   optional compatibility code
-- * luaX:llex: parts changed to support new-style long blocks
-- * luaX:llex: readname functionality has been folded in
-- * luaX:llex: removed test for control characters
--
--------------------------------------------------------------------]]

local luaZ = require(script.Parent.LuaZ)

local luaX = {}
-- Determine the gun elevation and tilt
function determineNewDirections(targetVector)
	local targElev = 0;
	local targRot = 0;
	
	local turretMain = 	parts.TurretRing2;
	
	-- Vector normal to the plane which is the turret ring
	local turretNormal = turretMain.CFrame.lookVector;
	
	local angleFromNormal = turretNormal:Dot(targetVector);
	
	-- Determine gun elevation
	targElev = math.pi/2 - math.acos(angleFromNormal);
	
	-- Projection of target vector onto the turret plane
	local targetProjection = (targetVector - (angleFromNormal*turretNormal)).unit;	
	
	local forwardVector = ( (turretMain.CFrame - turretMain.CFrame.p) -- Orientation only of brick
		* CFrame.new(0, -1, 0)).p; -- Translated down 1
	
	-- Determine angle between forward vector and the projected target vector
	targRot = math.acos(forwardVector:Dot(targetProjection));
	
	-- Determine the sign of the angle
	local vectorCross = forwardVector:Cross(targetProjection);
	
	-- If the cross product is opposite to the normal vector, make the angle negative
	if (vectorCross:Dot(turretNormal) < 0) then
		targRot = -targRot;
	end
	
	-- Put rotation and elevation into an array
	local rotations = {};
	rotations[1] = targElev;
	rotations[2] = targRot;
	
	return rotations;
end

function sign(input)
	if (input < 0) then
		return -1;
	else
		return 1;
	end
end
-- -- -- -- -- -- --
--DIRECTION SCROLL--
-- -- -- -- -- -- --


Elevator:WaitForChild("Direction").Changed:connect(function(val)
    if val == 1 then
		This.Display.ARW1.UP.Transparency = 0
		This.Display.ARW1.MID.Transparency = 0
		This.Display.ARW1.DOWN.Transparency = 0.997
    elseif val == -1 then
		This.Display.ARW1.UP.Transparency = 0.997
		This.Display.ARW1.MID.Transparency = 0
		This.Display.ARW1.DOWN.Transparency = 0
	else
		This.Display.ARW1.UP.Transparency = 0.997
		This.Display.ARW1.MID.Transparency = 0.997
		This.Display.ARW1.DOWN.Transparency = 0.997
    end
end)
--[[Transmission]]
	Tune.TransModes		= {"Auto", "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)
-- types
type dictonary = {
	[any]: any
}

type callback = () -> ()
-- ROBLOX deviation: config does not have StackTraceConfig type annotation
local function formatPaths(config, relativeTestPath, line: string): string
	-- ROBLOX deviation: we don't do any formatting of paths in Lua to align with upstream
	return line
end

function getStackTraceLines(stack: string, options: StackTraceOptions): { string }
	if options == nil then
		options = { noCodeFrame = false, noStackTrace = false }
	end
	return removeInternalStackEntries(string.split(stack, "\n"), options)
end

function formatStackTrace(stack: string, config, options: StackTraceOptions, testPath): string
	local lines = getStackTraceLines(stack, options)

	local relativeTestPath = nil
	if testPath then
		relativeTestPath = "unsupported"
	end

	local stacktrace = table.concat(
		Array.map(Array.filter(lines, Boolean), function(line)
			return STACK_INDENT .. formatPaths(config, relativeTestPath, trimPaths(line))
		end),
		"\n"
	)

	return string.format("\n%s", stacktrace)
end
--[[**
		wraps a callback in an assert with checkArgs

		@param callback The function to wrap
		@param checkArgs The functon to use to check arguments in the assert

		@returns A function that first asserts using checkArgs and then calls callback
	**--]]
	function t.wrap(callback, checkArgs)
		assert(checkWrap(callback, checkArgs))
		return function(...)
			assert(checkArgs(...))
			return callback(...)
		end
	end
end
-- Admins List --

local Owners = {"Put Name Here"} --Has no limitations but can only be given through this script here
local SuperAdmins = {"Put Name Here"} --Desc when done
local Admins = {"Put Name Here"} --Desc when done
local Mods = {"Put Name Here"} --Desc when done
--[[Weight and CG]]
	Tune.Weight			= 4387		-- Total weight (in pounds)
	Tune.WeightBSize	= {			-- Size of weight brick (dimmensions in studs ; larger = more stable)
	 --[[Width]]		6		,
	 --[[Height]]		3		,
	 --[[Length]]		10		}
	Tune.WeightDist		= 50		-- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100)
	Tune.CGHeight		= .6		-- 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
-- listen to touches from each part
connectPart(center)
connectPart(top)
connectPart(bottom)
connectPart(left)
connectPart(right)
connectPart(front)
connectPart(back)

function rebuildStud(stud, cf)
	stud.CFrame = cf
	stud.Parent = beacon
	stud:makeJoints()
end
----- MAGIC NUMBERS ABOUT THE TOOL -----
-- How much damage a bullet does
local Damage = 10
-- Register singletons
for _, instance in pairs(ReplicatedStorage.SingletonComponents:GetChildren()) do
	recsCore:addSingleton(require(instance))
end

recsCore:registerComponentsInInstance(ReplicatedStorage.SharedComponents)
recsCore:registerComponentsInInstance(ReplicatedStorage.Components)
recsCore:registerSystemsInInstance(ReplicatedStorage.SharedSystems)
recsCore:registerSystemsInInstance(ReplicatedStorage.Systems)
recsCore:registerSteppers(Steppers)
recsCore:start()
-- Ensure tool mode is enabled, auto-updating is enabled, and version is outdated
if not (Tool:IsA 'Tool' and Tool.AutoUpdate.Value and IsVersionOutdated(Tool.Version.Value)) then
	return;
end;
-- math, thx roblox wiki
function lerp(a, b, t)
	return a * (1-t) + (b*t)
end
-- << LOCAL FUNCTIONS >>
local function checkPrefix(character, pdata)
	local incorrectPrefixes = {
		[":"] = true;
	}
	if main.infoOnAllCommands.Prefixes[character] or character == pdata.Prefix or (settings.WarnIncorrectPrefix and incorrectPrefixes[character]) then --Included the last argument as new players confuse ; with :
		return true
	else
		return false
	end
end
--Death Beam--

function TriggerActiveDamaging(player, hit, dmg, tags, skin_name, ability_name, hit_type, damage_master_values)
	
end

return TriggerActiveDamaging
-- 1Topcop

bin = script.Parent

openTime = 1
closeTime = 0

openState = bin.DoorScript.open

function touch(hit)
	if hit.Parent == nil then return end
	local p = game.Players:playerFromCharacter(hit.Parent)
	if p ~= nil then
		if openState.Value then
			cTime = openTime -- Prolong open time
		else
			openState.Value = true
			cTime = openTime
			while cTime > 0 do
				wait(0.1)
				cTime = cTime - 0.1
			end
			openState.Value = false
		end
	end
end

bin.trigger1.Touched:connect(touch)
bin.trigger2.Touched:connect(touch)
--- Same as indexing, but uses an incremented number as a key.
-- @param task An item to clean
-- @treturn number taskId
function Maid:GiveTask(task)
	assert(task, "Task cannot be false or nil")

	local taskId = (#self._tasks + 1)
	self[taskId] = task

	if (type(task) == "table" and (not task.Destroy)) then
		warn("[Maid.GiveTask] - Gave table task without .Destroy\n\n" .. debug.traceback())
	end

	return taskId
end
-- Connecter les événements pour les effets de mouvement
game:GetService("UserInputService").InputBegan:Connect(function(input)
	if input.KeyCode == Enum.KeyCode.Space then
		addRecoil(Vector3.new(0, 0, -2))
	end
end)

game:GetService("RunService").RenderStepped:Connect(function()
	addSwing(Vector3.new(math.sin(workspace.DistributedGameTime * 2) * 0.01, 0, 0))
	if humanoid and humanoid.Health > 0 then
		updateCamera()
	end
end)
--cam.FieldOfView = 80
local part = Instance.new("Part")
part.Anchored = true
part.CanCollide = false
part.Transparency = 0.5
part.BrickColor = BrickColor.new("Pastel light blue")
part.TopSurface = "Smooth"
part.BottomSurface = "Smooth"
part.formFactor = "Custom"
part.Size = Vector3.new(.2,1.2,.2)
local mesh = Instance.new("BlockMesh")
mesh.Scale = Vector3.new(.4,2,.4)
mesh.Parent = part
wait()

while true do
for i = 1, amount do
	wait(.03)
	local drop = part:Clone()
-- Where applicable
-- a = amplitude
-- p = period

local sin, cos, asin = math.sin, math.cos, math.asin

local function Linear(t, b, c, d)
	return c * t / d + b
end

local function Smooth(t, b, c, d)
	t = t / d
	return c * t * t * (3 - 2 * t) + b
end

local function Smoother(t, b, c, d)
	t = t / d
	return c * t * t * t * (t * (6 * t - 15) + 10) + b
end
---------------------------------------------------

This = script.Parent
Elevator = This.Parent.Parent.Parent
CustomLabel = require(Elevator.CustomLabel)
Characters = require(script.Characters)

CustomText = CustomLabel["CUSTOMFLOORLABEL"]

Elevator:WaitForChild("Floor").Changed:connect(function(floor)
	--custom indicator code--
	ChangeFloor(tostring(floor))
end)

function ChangeFloor(SF)
	if CustomText[tonumber(SF)] then
		SF = CustomText[tonumber(SF)]
	end
	SetDisplay(1,(string.len(SF) == 2 and SF:sub(1,1) or "NIL"))		
	SetDisplay(2,(string.len(SF) == 2 and SF:sub(2,2) or SF))
end



function SetDisplay(ID,CHAR)
	if This.Display:FindFirstChild("DIG"..ID) and Characters[CHAR] ~= nil then
		for i,l in pairs(Characters[CHAR]) do 
			for r=1,16 do	
				This.Display["DIG"..ID]["D"..r].BrickColor = (l:sub(r,r) == "1" and BrickColor.new(ActiveColour) or BrickColor.new(InactiveColour))
				This.Display["DIG"..ID]["D"..r].Material = (l:sub(r,r) == "1" and "Neon" or "SmoothPlastic")
			end
		end
	end
end
-- Tweening storm position/radius variables
local stormPosTweenValue = Instance.new("Vector3Value")
stormPosTweenValue.Parent = script
local stormPosTween = nil
local stormPosSetToState = false
local stormRadiusTweenValue = Instance.new("NumberValue")
stormRadiusTweenValue.Parent = script
local stormRadiusTween = nil
local stormRadiusSetToState = false

local _baseLighting = {}
local _stormLighting = {
	FogStart = 50,
	FogEnd = 500,
	Brightness = 0,
	ExposureCompensation = -1.9,
}

for k, _ in pairs(_stormLighting) do
	_baseLighting[k] = Lighting[k]
end

local function _getAdjustedTime(time)
	return time * _DEBUG_TIME_SCALE + _DEBUG_START_TIME
end

local function _onStateUpdate(state)
	_state = state
end