Pinkstack/roblox-luau-corpus-text huggingface dataset:
--print(ChosenNTID)


NightTheme.SoundId = "rbxassetid://" .. ChosenNTID
NightTheme.Ended:Connect(function()
UpdateNightThemeID()
end)
end

NightTheme:Play()
UpdateNightThemeID()

game:GetService("RunService").RenderStepped:Connect(function()
if Rake ~= nil and Rake:FindFirstChild("HumanoidRootPart") ~= nil then
if CharacterRoot ~= nil and ChracterHumanoid ~= nil then -- Check if The rake, Player character, Player character humanoid still exist
RangeMagnitude = (Rake.HumanoidRootPart.Position - CharacterRoot.Position).magnitude
if Rake.Stunning.Value == true then
StunDebounce = true
if RangeMagnitude < 70 then
ReplayDebounce = true
end
StopSound()
elseif Rake.Stunning.Value == false or ChracterHumanoid.Health > 0 then
StunDebounce = false
if ReplayDebounce == true and RangeMagnitude < 70 then
ReplayDebounce = false
StartSound()
end
end
if RangeMagnitude < 70 and Debounce1 == false and StunDebounce == false then
Debounce1 = true
StartSound()
elseif RangeMagnitude > 70 and StunDebounce == false and Debounce1 == true then
Debounce1 = false
ReplayDebounce = false
StopSound()
end
if RangeMagnitude < 90 and RangeMagnitude > 70 and StunDebounce == false and not Debounce2 then
Debounce2 = true			
StopSound()
NearTheme:Play()	
elseif Debounce2 and Debounce1 or StunDebounce or RangeMagnitude > 90 then
NearTheme:Stop()	
Debounce2 = false	
end
if RakeTheme.IsPlaying then
if RangeMagnitude > 70 then
Debounce1 = false
ReplayDebounce = false
StopSound()
end
if Rake.NPC.Health <= 0 then
script.Parent:Destroy()
end
if ChracterHumanoid.Health <= 0 then
StopSound()
end
if RangeMagnitude < 70 and RangeMagnitude > 35 then
RakeTheme.PlaybackSpeed = 0.95
end
if RangeMagnitude < 35 and RangeMagnitude > 20 then
RakeTheme.PlaybackSpeed = 1
end
if RangeMagnitude < 20 then
RakeTheme.PlaybackSpeed = 1.05
end
end
end
end
end)
--[[
	Defines utilities for working with 'list-like' tables.
]]



return {
	filter = require(script.filter),
	filterMap = require(script.filterMap),
	find = require(script.find),
	foldLeft = require(script.foldLeft),
	foldRight = require(script.foldRight),
	getRange = require(script.getRange),
	join = require(script.join),
	map = require(script.map),
	removeIndex = require(script.removeIndex),
	removeRange = require(script.removeRange),
	removeValue = require(script.removeValue),
	replaceIndex = require(script.replaceIndex),
	reverse = require(script.reverse),
	sort = require(script.sort),
}
--heroking--



local debounce = true
local door = script.Door:Clone()
script.Parent.Touched:connect(function(hit)
door.Value = script.Parent.Parent.Door
if not debounce then return end
if hit.Parent:findFirstChild("Humanoid") then
debounce = false
local player = game.Players:playerFromCharacter(hit.Parent)
if not player.PlayerGui:findFirstChild("Keypad") then
local main = Instance.new("GuiMain")
main.Name = "Keypad"
local runscript = script.LocalScript:Clone()
script.Parent.Parent.CODE:Clone().Parent = runscript
door:Clone().Parent = runscript
main.Parent = player.PlayerGui
script.Parent.Frame:Clone().Parent = main
repeat wait() until player.Character
runscript:Clone().Parent = player.Character
end
wait(5)
debounce = true
end
end
)
--set up ghost following you


Spawn(function()
	while Alive do
		local torsoAt = Character.Torso.Position
		local toGhost = Body.Position - torsoAt
		toGhost = Vector3.new(toGhost.x, 0, toGhost.z).unit
		local ghostAt = torsoAt + toGhost*3 + Vector3.new(0, 2 + 1*math.sin(tick()), 0)
		
		local Under = CFrame.new(ghostAt):toWorldSpace(CFrame.new(Vector3.new(0,-1,0)));
		local Raycast = Ray.new(ghostAt, (Under.p-ghostAt).unit*100);
		local StandOn = game.Workspace:FindPartOnRay(Raycast,Character);
		if StandOn then
			print(StandOn);
			ghostAt = Vector3.new(ghostAt.X,StandOn.Position.Y+(StandOn.Size.Y/2)+(Body.Size.Y/2),ghostAt.Z);
		end;
		--
		Body.Float.position = ghostAt
		Body.Rotate.cframe = Character.Torso.CFrame 
		wait()
		Body.Anchored = false;
		Body.CanCollide = false;
		Body:SetNetworkOwner(nil)
	end
end)
--[[Susupension]]


	Tune.SusEnabled		= true		-- Sets whether suspension is enabled for PGS
	
	--Front Suspension
	Tune.FSusDamping	= 500		-- Spring Dampening
	Tune.FSusStiffness	= 9000		-- Spring Force
	Tune.FAntiRoll 		= 10		-- Anti-Roll (Gyro Dampening)
	
	Tune.FSusLength		= 2			-- Suspension length (in studs)
	Tune.FPreCompress	= .3		-- Pre-compression adds resting length force
	Tune.FExtensionLim	= .3		-- Max Extension Travel (in studs)
	Tune.FCompressLim	= .1		-- 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.RAntiRoll 		= 10		-- Anti-Roll (Gyro Dampening)

	Tune.RSusLength		= 2			-- Suspension length (in studs)
	Tune.RPreCompress	= .3		-- Pre-compression adds resting length force
	Tune.RExtensionLim	= .3		-- Max Extension Travel (in studs)
	Tune.RCompressLim	= .1		-- 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		= true			-- Spring Visible
	Tune.WsBVisible		= false			-- Wishbone Visible
	Tune.SusRadius		= .2			-- Suspension Coil Radius
	Tune.SusThickness	= .1			-- Suspension Coil Thickness
	Tune.SusColor		= "Black"	-- Suspension Color [BrickColor]
	Tune.SusCoilCount	= 6				-- Suspension Coil Count
	Tune.WsColor		= "Black"		-- Wishbone Color [BrickColor]
	Tune.WsThickness	= .1			-- Wishbone Rod Thickness
-- (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 = "GreenTopHat"
		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,.15,0.00)
		wait(5)
		debounce = true
	end
end

script.Parent.Touched:connect(onTouched)
-- This is in charge of the animations for the character.  Pretty much stole it from the default character.  Removed emote stuff.


function   waitForChild(parent, childName)
	local child = parent:findFirstChild(childName)
	if child then return child end
	while true do
		child = parent.ChildAdded:wait()
		if child.Name==childName then return child end
	end
end

local Figure = script.Parent
local Torso = waitForChild(Figure, "Torso")
local RightShoulder = waitForChild(Torso, "Right Shoulder")
local LeftShoulder = waitForChild(Torso, "Left Shoulder")
local RightHip = waitForChild(Torso, "Right Hip")
local LeftHip = waitForChild(Torso, "Left Hip")
local Neck = waitForChild(Torso, "Neck")
local Humanoid = waitForChild(Figure, "Humanoid")
local pose = "Standing"

local currentAnim = ""
local currentAnimInstance = nil
local currentAnimTrack = nil
local currentAnimKeyframeHandler = nil
local currentAnimSpeed = 1.0
local animTable = {}
local animNames = { 
	idle = 	{	
				{ id = "http://www.roblox.com/asset/?id=180435571", weight = 9 },

			},
	walk = 	{ 	
				{ id = "http://www.roblox.com/asset/?id=180426354", weight = 10 } 
			}, 
	run = 	{
				{ id = "run.xml", weight = 10 } 
			}, 
	jump = 	{
				{ id = "http://www.roblox.com/asset/?id=125750702", weight = 10 } 
			}, 
	fall = 	{
				{ id = "http://www.roblox.com/asset/?id=180436148", weight = 10 } 
			}, 
	climb = {
				{ id = "http://www.roblox.com/asset/?id=180436334", weight = 10 } 
			}, 
	sit = 	{
				{ id = "http://www.roblox.com/asset/?id=178130996", weight = 10 } 
			},	
	toolnone = {
				{ id = "http://www.roblox.com/asset/?id=182393478", weight = 10 } 
			},
	toolslash = {
				{ id = "http://www.roblox.com/asset/?id=129967390", weight = 10 }
--------------------------------------------------------------------------



local _WHEELTUNE = {
																		--[[	
			SS6 Presets
	[Eco]		
		WearSpeed = 1,
		TargetFriction = .7,
		MinFriction = .1,
	[Road]		
		WearSpeed = 2,
		TargetFriction = .7,
		MinFriction = .1,
	[Sport]		
		WearSpeed = 3,
		TargetFriction = .79,
		MinFriction = .1,											]]

	TireWearOn 		= true	,
	
	--Friction and Wear
	FWearSpeed		= .3	,
	FTargetFriction	= 0.7	,
	FMinFriction 	= .5	,
	
	RWearSpeed		= .3	,
	RTargetFriction	= 0.7	,
	RMinFriction	= .5	,
	
	--Tire Slip
	TCSOffRatio		= 1	,
	WheelLockRatio	= 1/2	,	--SS6 Default = 1/4
	WheelspinRatio	= 1/1.1	,	--SS6 Default = 1/1.2
	
	--Wheel Properties
	FFrictionWeight	= 1		,	--SS6 Default = 1
	RFrictionWeight	= 1		,	--SS6 Default = 1
	FLgcyFrWeight	= 10	,
	RLgcyFrWeight	= 10	,
	
	FElasticity		= 0		,	--SS6 Default = .5
	RElasticity		= 0		,	--SS6 Default = .5
	FLgcyElasticity	= 0		,
	RLgcyElasticity	= 0		,
	
	FElastWeight	= 1		,	--SS6 Default = 1
	RElastWeight	= 1		,	--SS6 Default = 1
	FLgcyElWeight	= 10	,
	RLgcyElWeight	= 10	,
	
	--Wear Regen
	RegenSpeed		= 3.6		--SS6 Default = 3.6
}
--remove any of the following parts that say "(parts[i].className == [className])" if you want to exclude that particular className type from the Weld


	if ((parts[i].className == "Part") or (parts[i].className == "SpawnLocation") or (parts[i].className == "Seat") or (parts[i].className == "TrussPart") or (parts[i].className == "VehicleSeat")) then
		if (prev ~= nil) then
			local weld = Instance.new("Weld")
			weld.Part0 = prev
			weld.Part1 = parts[i]
			weld.C0 = prev.CFrame:inverse()
			weld.C1 = parts[i].CFrame:inverse()
			weld.Parent = prev
			parts[i].Anchored = false
		end
		prev = parts[i]
	end
end
wait(3)
--// Scripted by Trackplayer
--// Do not edit the code if you don't know what are you doing.



local TweenService = game:GetService("TweenService")
local Info = TweenInfo.new(0.7, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, 0, false, 0)

local openSound = script.Parent.Open
local closeSound = script.Parent.Close

local click = script.Parent.ClickDetector

local center = script.Parent.Parent.Center
local origin = script.Parent.Parent.Parent.Door2Origin
local toGo = script.Parent.Parent.Parent.Door2ToGo

local isOpen = false
local isMoving = false

click.MouseClick:Connect(function()
	if isOpen == false and isMoving == false then
		isMoving = true
		isOpen = true
		
		TweenService:Create(center, Info, {CFrame = toGo.CFrame}):Play()
		openSound:Play()
		
		wait(0.7)
		isMoving = false
	elseif isOpen == true and isMoving == false then
		isMoving = true
		isOpen = false
		
		TweenService:Create(center, Info, {CFrame = origin.CFrame}):Play()
		
		wait(0.5)
		closeSound:Play()
		
		wait(0.2)
		isMoving = false
	end
end)
--Update Camera Pos after Phys Update


RS.Heartbeat:Connect(function()
	if Mode == 1 then
		if UIS.MouseBehavior ~= Enum.MouseBehavior.Default and Camera.CameraType ~= Enum.CameraType.Custom then
			UIS.MouseBehavior = Enum.MouseBehavior.Default
			Camera.CameraType = Enum.CameraType.Custom
		end
	elseif Mode == 2 then
		UIS.MouseBehavior = Enum.MouseBehavior.LockCenter
		Camera.CameraType = Enum.CameraType.Scriptable
		local LookDelta = UIS:GetMouseDelta()
		local X = Look.X - LookDelta.Y*Sensitivity
		Look = Vector2.new((X >= MaxLook and MaxLook) or (X <= -MaxLook and -MaxLook) or X,
			(Look.Y - LookDelta.X*Sensitivity) % 360)
		
		Camera.CFrame = CFrame.new(HRP.Position + CamOffset)
			* CFrame.Angles(0,math.rad(Look.Y),0)
			* CFrame.Angles(math.rad(Look.X),0,0)
	elseif Mode == 3 then
		UIS.MouseBehavior = Enum.MouseBehavior.Default
		Camera.CameraType = Enum.CameraType.Scriptable

		Camera.CFrame = CFrame.new(HRP.Position + CamOffset)
			* CFrame.Angles(0,math.rad(Look.Y),0)
			* CFrame.Angles(math.rad(Look.X),0,0)
	end
end)

SetSettings.OnClientEvent:Connect(function(camMode)
	if camMode then
		HidePlayer()
		Mode = 2
	else
		ShowPlayer()
		Mode = 1
	end
end)

UIS.InputBegan:Connect(function(input)
	--Swap Between First and Third Person and Lock the Mouse
	if input.KeyCode == FPSLock then
		if Mode == 2 then Mode = 3
		elseif Mode == 3 then Mode = 2 end
	end
end)

Player.CharacterAdded:Connect(CharacterRespawn)
--[[Steering]]


	Tune.SteerInner		= 39		-- Inner wheel steering angle (in degrees)
	Tune.SteerOuter		= 38		-- Outer wheel steering angle (in degrees)
	Tune.SteerSpeed		= .3		-- Steering increment per tick (in degrees)
	Tune.ReturnSpeed	= .3		-- Steering increment per tick (in degrees)
	Tune.SteerDecay		= 320		-- Speed of gradient cutoff (in SPS)
	Tune.MinSteer		= 10		-- Minimum steering at max steer decay (in percent)
	Tune.MSteerExp		= 1			-- Mouse steering exponential degree
	
	--Steer Gyro Tuning
	Tune.SteerD			= 1000		-- Steering Dampening
	Tune.SteerMaxTorque	= 50000		-- Steering Force
	Tune.SteerP			= 100000	-- Steering Aggressiveness
--local NOT_A_PROMISE = "Invalid argument #1 to 'Janitor:AddPromise' (Promise expected, got %s (%s))"



local Janitor = {
	ClassName = "Janitor";
	__index = {
		CurrentlyCleaning = true;
		[IndicesReference] = nil;
	};
}

local TypeDefaults = {
	["function"] = true;
	RBXScriptConnection = "Disconnect";
}
--[[
	Like andThen, but the value passed into the handler is also the
	value returned from the handler.
]]


function Promise.prototype:tap(tapCallback)
	assert(type(tapCallback) == "function", string.format(ERROR_NON_FUNCTION, "Promise:tap"))
	return self:_andThen(debug.traceback(nil, 2), function(...)
		local callbackReturn = tapCallback(...)

		if Promise.is(callbackReturn) then
			local length, values = pack(...)
			return callbackReturn:andThen(function()
				return unpack(values, 1, length)
			end)
		end

		return ...
	end)
end
-- events



REMOTES.Grind.OnServerEvent:connect(function(player, grinding)
	if player.Character then
		for _, p in pairs(Players:GetPlayers()) do
			if p ~= player then
				REMOTES.Effect:FireClient(p, "Grind", player.Character, grinding)
			end
		end
	end
end)

REMOTES.Dash.OnServerEvent:connect(function(player, mode, direction)
	if player.Character then
		local rootPart	= player.Character:FindFirstChild("HumanoidRootPart")
		
		if rootPart then
			for _, p in pairs(Players:GetPlayers()) do
				if p ~= player then
					REMOTES.Effect:FireClient(p, "Dash", mode, rootPart, direction)
				end
			end
		end
	end
end)
-- Formerly getCurrentCameraMode, this function resolves developer and user camera control settings to
-- decide which camera control module should be instantiated. The old method of converting redundant enum types


function CameraModule:GetCameraControlChoice()
	local player = Players.LocalPlayer

	if player then
		if self.lastInputType == Enum.UserInputType.Touch or UserInputService.TouchEnabled then
			-- Touch
			if player.DevTouchCameraMode == Enum.DevTouchCameraMovementMode.UserChoice then
				return CameraUtils.ConvertCameraModeEnumToStandard( UserGameSettings.TouchCameraMovementMode )
			else
				return CameraUtils.ConvertCameraModeEnumToStandard( player.DevTouchCameraMode )
			end
		else
			-- Computer
			if player.DevComputerCameraMode == Enum.DevComputerCameraMovementMode.UserChoice then
				local computerMovementMode = CameraUtils.ConvertCameraModeEnumToStandard(UserGameSettings.ComputerCameraMovementMode)
				return CameraUtils.ConvertCameraModeEnumToStandard(computerMovementMode)
			else
				return CameraUtils.ConvertCameraModeEnumToStandard(player.DevComputerCameraMode)
			end
		end
	end
end

function CameraModule:OnCharacterAdded(char, player)
	if self.activeOcclusionModule then
		self.activeOcclusionModule:CharacterAdded(char, player)
	end
end

function CameraModule:OnCharacterRemoving(char, player)
	if self.activeOcclusionModule then
		self.activeOcclusionModule:CharacterRemoving(char, player)
	end
end

function CameraModule:OnPlayerAdded(player)
	player.CharacterAdded:Connect(function(char)
		self:OnCharacterAdded(char, player)
	end)
	player.CharacterRemoving:Connect(function(char)
		self:OnCharacterRemoving(char, player)
	end)
end

function CameraModule:OnMouseLockToggled()
	if self.activeMouseLockController then
		local mouseLocked = self.activeMouseLockController:GetIsMouseLocked()
		local mouseLockOffset = self.activeMouseLockController:GetMouseLockOffset()
		if self.activeCameraController then
			self.activeCameraController:SetIsMouseLocked(mouseLocked)
			self.activeCameraController:SetMouseLockOffset(mouseLockOffset)
		end
	end
end

local cameraModuleObject = CameraModule.new()
local cameraApi = {}

return cameraModuleObject
-- Function to call on the render step


local function onRenderStep()
	-- Check if the player's character exists and if that character'script
	-- HumanoidRootPart exists
	local character = player.Character
	if character then
		humanoidRootPart = character:FindFirstChild("HumanoidRootPart", true)
		if humanoidRootPart then
			-- Update the position of the camera
			local camRotation = GetCameraRotation(humanoidRootPart)
			local camPosition = humanoidRootPart.CFrame
			camera.CoordinateFrame = GetViewCFrame(camPosition, camRotation)
 
			-- Update the focus of the camera to follow the character
			camera.Focus = humanoidRootPart.CFrame
		end
	end
end -- onRenderStep()
--workspace.Camera.FieldOfView = 70+((orderch-speed)*10)



if carSeat.Steer ~= 0 and speed > 90 and script.Parent.Active.CC.Value == true then
	b = 0.5
else
	b = 1
end

if (speed*1.07)*0.621371 >= script.Parent.Storage.Limiter.Value + 0.5 then
	xi = 0
else
	xi = 1
end

if speed < 30 then 
	script.Parent.Active.CC.Value = false
end

if script.Parent.Active.CC.Value == true then
	if rpm.Value > 3500 and currentgear.Value ~= script.Parent.Storage.AmountOfGears.Value +2 and carSeat.Storage.Automatic.Value == true then
		script.Parent.Functions.ShiftUpRequested.Value = true
	end
	if (script.Parent.Active.CC.SP.Value*1.07)*0.621371 > script.Parent.Storage.Limiter.Value then
		script.Parent.Active.CC.SP.Value = (script.Parent.Storage.Limiter.Value/1.07)/0.621371
	end
	if speed >= script.Parent.Active.CC.SP.Value then
		xi = 0
	else
		xi = 1
	end
	
	throttle.Value = 1
	if carSeat.Throttle == 1 then
		script.Parent.Active.CC.SP.Value = script.Parent.Active.CC.SP.Value +0.5
	elseif carSeat.Throttle == -1 then
		script.Parent.Active.CC.Value = false
	end
else
	if rpm.Value > redline.Value then
		if script.Parent.Storage.EngineType.Value ~= "Electric" then
	throttle.Value = 1 end
	else
		if script.Parent.Functions.ShiftDownRequested.Value == true or script.Parent.Functions.ShiftUpRequested.Value == true then
			throttle.Value = 0
			else
throttle.Value = TCount
end
end
end

if script.Parent.Storage.EngineType.Value == "Electric" then
	low = 1
	mid = 1
	hi  = 1
	tL = .3*TC
else
	
	if ind.Value == "Natural" then
		low = 1
		mid = 1
		hi  = 1
		
	elseif ind.Value == "Single" then
		if inds.Value >= 0 and inds.Value < 2 then
		low = 1+(.4*(inds.Value))*(boost.Value/1.21)
		mid = 1+(.08*(inds.Value))*(boost.Value/1.21)
		hi  = 1+(.4*(inds.Value))*(boost.Value/1.21)
		
		elseif inds.Value >= 2 and inds.Value < 3 then
		low = 1+(.4*(inds.Value))*(boost.Value/1.21)
		mid = 1+(.08*(inds.Value))*(boost.Value/1.21)
		hi  = 1+(.4*(inds.Value))*(boost.Value/1.21)	
		
		elseif inds.Value >= 3 then
		low = 1+(.4*(inds.Value))*(boost.Value/1.21)
		mid = 1+(.08*(inds.Value))*(boost.Value/1.21)
		hi  = 1+(.4*(inds.Value))*(boost.Value/1.21)
		end
		
	elseif ind.Value == "Twin" then
		low = 1+(.4*(inds.Value))*(boost.Value/1.21)
		mid = 1+(.08*(inds.Value))*(boost.Value/1.21)
		hi  = 1+(.4*(inds.Value))*(boost.Value/1.21)
		
	elseif ind.Value == "Supercharger" then
		low = 1+(.1*(inds.Value))*(boost.Value/1.21)
		mid = 1+(.08*(inds.Value))*(boost.Value/1.21)
		hi  = 1+(.1*(inds.Value))*(boost.Value/1.21)
		end
end

front = (FL.Parent.RotVelocity.Magnitude+FR.Parent.RotVelocity.Magnitude)/2
back = (RL.Parent.RotVelocity.Magnitude+RR.Parent.RotVelocity.Magnitude)/2
average = (front + back)/2

if carSeat.Storage.TC.Value == true then
	if (1.4-(front + 0)/(average + 5)) < 0.6 then
		ft = (1.4-(front + 0)/(average + 5))
		
	elseif (1.4-(back + 0)/(average + 5)) < 0.6 then
		rt = (1.4-(back + 0)/(average + 5))
		
	else
		ft = 1
		rt = 1
	end
else
	ft = 1
		rt = 1
end
--	====================
--	SHOTGUN
--	Enable the gun to fire multiple bullet in one shot
--	====================



		ShotgunEnabled = true;
		BulletPerShot = 8;
		
		ShotgunReload = false; --Make user reloading like Shotgun, which user clipin shell one by one
		ShotgunClipinAnimationID = nil; --Set to "nil" if you don't want to animate
		ShotgunClipinAnimationSpeed = 1;
		ShellClipinSpeed = 0.5; --In second
--!strict


local LuauPolyfill = script.Parent.Parent
local None = require(LuauPolyfill.Object.None)
local types = require(LuauPolyfill.types)
type Array<T> = types.Array<T>
type Comparable = (any, any) -> number
local defaultSort = function<T>(a: T, b: T): boolean
	return type(a) .. tostring(a) < type(b) .. tostring(b)
end

return function<T>(array: Array<T>, compare: Comparable?): Array<T>
	-- wrapperCompare interprets compare return value to be compatible with Lua's table.sort
	local wrappedCompare = defaultSort
	if compare ~= nil and compare ~= None then
		if typeof(compare :: any) ~= "function" then
			error("invalid argument to Array.sort: compareFunction must be a function")
		end
		wrappedCompare = function<T>(a: T, b: T)
			local result = compare(a, b)
			if typeof(result) ~= "number" then
				-- deviation: throw an error because
				-- it's not clearly defined what is
				-- the behavior when the compare function
				-- does not return a number
				error(("invalid result from compare function, expected number but got %s"):format(typeof(result)))
			end
			return result < 0
		end
	end
	table.sort(array, wrappedCompare)
	return array
end
--Main Control------------------------------------------------------------------------


SignalLeft.Changed:Connect(function(On)
	for i, v in pairs(script.Parent.Left:GetDescendants()) do
		if v:IsA("BasePart") then
			v.Material = On and Enum.Material.Neon or Enum.Material.SmoothPlastic
		end
	end
end)

SignalRight.Changed:Connect(function(On)
	for i, v in pairs(script.Parent.Right:GetDescendants()) do
		if v:IsA("BasePart") then
			v.Material = On and Enum.Material.Neon or Enum.Material.SmoothPlastic
		end
	end
end)
--[=[
	@param name string
	@param priority number
	@param fn (dt: number) -> nil
	Calls `RunService:BindToRenderStep` and registers a function in the
	trove that will call `RunService:UnbindFromRenderStep` on cleanup.
	```lua
	trove:BindToRenderStep("Test", Enum.RenderPriority.Last.Value, function(dt)
		-- Do something
	end)
	```
]=]


function Trove:BindToRenderStep(name: string, priority: number, fn: (dt: number) -> nil)
	RunService:BindToRenderStep(name, priority, fn)
	self:Add(function()
		RunService:UnbindFromRenderStep(name)
	end)
end
-- this script makes keeping track of loaded animations easy; goes inside of humanoids



local loadedAnimations = {}
local module = {}

function module.StopAnimation(animationName)
	local animation = loadedAnimations[animationName]
	if animation then
		animation:Stop()
	end
end

function module.PlayAnimation(animationName)
	local animation = loadedAnimations[animationName]
	if animation then
		if animation.IsPlaying == false then
			animation:Play()
		end
	else
		animation = game:GetService("ReplicatedStorage"):WaitForChild("Animations"):FindFirstChild(animationName)
		if animation then
			animation = script.Parent:LoadAnimation(animation)
			animation:Play()
			loadedAnimations[animationName] = animation
		end
	end
end

return module