Pinkstack/roblox-luau-corpus-text huggingface dataset:
--// Screen controls for AC6 by Itzt, originally for 2014 Infiniti QX80. i don't know how to tune ac lol


 
wait(0.1)
local player = game.Players.LocalPlayer
local HUB = script.Parent.HUB
local TR = script.Parent.Tracker
local limitButton = HUB.Name
local lightOn = false
local Camera = game.Workspace.CurrentCamera
local cam = script.Parent.nxtcam.Value
local carSeat = script.Parent.CarSeat.Value
local mouse = game.Players.LocalPlayer:GetMouse()
local windows = false
local winfob = HUB.Parent.Windows
-------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------




function onRunning(speed)
	speed /= getRigScale()
	
	if speed > 0.01 then
		playAnimation("walk", 0.1, Humanoid)
		if currentAnimInstance and currentAnimInstance.AnimationId == "http://www.roblox.com/asset/?id=180426354" then
			setAnimationSpeed(speed / 14.5)
		end
		pose = "Running"
	else
		if emoteNames[currentAnim] == nil then
			playAnimation("idle", 0.1, Humanoid)
			pose = "Standing"
		end
	end
end

function onDied()
	pose = "Dead"
end

function onJumping()
	playAnimation("jump", 0.1, Humanoid)
	jumpAnimTime = jumpAnimDuration
	pose = "Jumping"
end

function onClimbing(speed)
	speed /= getRigScale()
	
	playAnimation("climb", 0.1, Humanoid)
	setAnimationSpeed(speed / 12.0)
	pose = "Climbing"
end

function onGettingUp()
	pose = "GettingUp"
end

function onFreeFall()
	if (jumpAnimTime <= 0) then
		playAnimation("fall", fallTransitionTime, Humanoid)
	end
	pose = "FreeFall"
end

function onFallingDown()
	pose = "FallingDown"
end

function onSeated()
	pose = "Seated"
end

function onPlatformStanding()
	pose = "PlatformStanding"
end

function onSwimming(speed)
	if speed > 0 then
		pose = "Running"
	else
		pose = "Standing"
	end
end

function getTool()	
	for _, kid in ipairs(Figure:GetChildren()) do
		if kid.className == "Tool" then return kid end
	end
	return nil
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

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
-- To make this work, simply group it with the model you want!




local modelbackup = script.Parent.Parent:FindFirstChild(modelname):clone()
local trigger = script.Parent

enabled = true

function onClick()

	if enabled == true then

		enabled = false
		trigger.BrickColor = BrickColor.new("Really black")

	if script.Parent.Parent:FindFirstChild(modelname) ~= nil then

		script.Parent.Parent:FindFirstChild(modelname):Destroy()

	end

		local modelclone = modelbackup:clone()
		modelclone.Parent = script.Parent.Parent
		modelclone:MakeJoints()



		wait(WaitTime)
		
		enabled = true
		trigger.BrickColor = BrickColor.new("Bright violet")

	end

end

script.Parent.ClickDetector.MouseClick:connect(onClick)
--[=[
	Flattens all the brios in one brio and combines them. Note that this method leads to
	gaps in the lifetime of the brio.

	@deprecated 3.6.0 -- This method does not wrap the resulting value in a Brio, which can sometimes lead to leaks.
	@param observables { [any]: Observable<Brio<T>> | Observable<T> | T }
	@return Observable<Brio<{ [any]: T }>>
]=]


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

	warn("[RxBrioUtils.combineLatest] - Deprecated since 3.6.0. Use RxBrioUtils.flatCombineLatest")

	return Rx.combineLatest(observables)
		:Pipe({
			Rx.map(BrioUtils.flatten);
			RxBrioUtils.onlyLastBrioSurvives();
		})
end
--[[
  -- product
   ["AssetId"] = 0,
    ["AssetTypeId"] = 0,
    ["Created"] = "2023-05-17T18:00:11.7196645Z",
    ["Creator"] =  ▶ {...},
    ["Description"] = "example description",
    ["DisplayDescription"] = "example description",
    ["DisplayIconImageAssetId"] = 0,
    ["DisplayName"] = "developer product test",
    ["IconImageAssetId"] = 0,
    ["IsForSale"] = true,
    ["IsLimited"] = false,
    ["IsLimitedUnique"] = false,
    ["IsNew"] = true,
    ["IsPublicDomain"] = false,
    ["MinimumMembershipLevel"] = 0,
    ["Name"] = "developer product test",
    ["PriceInRobux"] = 1000000000,
    ["ProductId"] = 1543290027,
    ["ProductType"] = "Developer Product",
    ["TargetId"] = 23596539,
    ["Updated"] = "2023-05-17T18:00:42.4963917Z"

  
  --badge
   {
    ["Description"] = "",
    ["IconImageId"] = 11132927395,
    ["IsEnabled"] = false,
    ["Name"] = "Example Badge"
  }
  
  	--BadgeService:GetBadgeInfoAsync()
	--BadgeService:AwardBadge()
	--BadgeService:UserHasBadgeAsync()
	
]]



function module.AwardBadge(userId: number, badgeId: number): boolean?
	local func = Functions.badges[badgeId]
	if not func or BadgeService:UserHasBadgeAsync(userId, badgeId) then return end
	
	local success, result = pcall(func, userId)
	assert(success, `AwardBadge error: {result}`)
	
	if result then
		BadgeService:AwardBadge(userId, badgeId)
	end
	return true
end
--- Returns a table containing the parsed values for all of the arguments.


function Command:GatherArgumentValues ()
	local values = {}

	for i = 1, #self.ArgumentDefinitions do
		local arg = self.Arguments[i]
		if arg then
			values[i] = arg:GetValue()
		elseif type(self.ArgumentDefinitions[i]) == "table" then
			values[i] = self.ArgumentDefinitions[i].Default
		end
	end

	return values, #self.ArgumentDefinitions
end
-- ROBLOX MOVED: expect/utils.lua
-- ROBLOX TODO: (LUAU) Add seenReferences type annotation once Luau can
-- recognize that the seenReferences or {} is sufficient to make seenReferences
-- non-nil


local function getObjectSubset(object: any, subset: any, seenReferences_: { [Object]: boolean }?): any
	local seenReferences = if seenReferences_ then seenReferences_ else {}

	if Array.isArray(object) then
		if Array.isArray(subset) and #subset == #object then
			-- The return correct subclass of subset
			local subsetMap = {}

			for i, sub in ipairs(subset) do
				table.insert(subsetMap, getObjectSubset(object[i], sub))
			end
			return subsetMap
		end
	elseif getType(object) == "DateTime" then
		return object
	elseif isObject(object) and isObject(subset) then
		if equals(object, subset, { iterableEquality, subsetEquality }) then
			return subset
		end

		local trimmed: any = {}
		seenReferences[object] = trimmed

		for i, key in
			ipairs(Array.filter(Object.keys(object), function(key)
				return hasPropertyInObject(subset, key)
			end))
		do
			if seenReferences[object[key]] ~= nil then
				trimmed[key] = seenReferences[object[key]]
			else
				trimmed[key] = getObjectSubset(object[key], subset[key], seenReferences)
			end
		end

		if #Object.keys(trimmed) > 0 then
			return trimmed
		end
	end

	return object
end

return {
	-- jasmineUtils.lua
	equals = equals,
	isA = isA,
	isAsymmetric = isAsymmetric,

	-- utils.lua
	getObjectSubset = getObjectSubset,
	iterableEquality = iterableEquality,
	subsetEquality = subsetEquality,
	isObjectWithKeys = isObjectWithKeys,
	hasPropertyInObject = hasPropertyInObject,
}
--[[
	Represents the state relevant while executing a test plan.

	Used by TestRunner to produce a TestResults object.

	Uses the same tree building structure as TestPlanBuilder; TestSession keeps
	track of a stack of nodes that represent the current path through the tree.
]]



local TestEnum = require(script.Parent.TestEnum)
local TestResults = require(script.Parent.TestResults)
local Context = require(script.Parent.Context)

local TestSession = {}

TestSession.__index = TestSession
--[[Susupension]]


	Tune.SusEnabled		= False		-- Sets whether suspension is enabled for PGS
	
	--Front Suspension
	Tune.FSusDamping	= 500		-- Spring Dampening
	Tune.FSusStiffness	= 9000		-- Spring Force
	Tune.FAntiRoll 		= 50		-- 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 		= 50		-- 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		= "Bright red"	-- Suspension Color [BrickColor]
	Tune.SusCoilCount	= 6				-- Suspension Coil Count
	Tune.WsColor		= "Black"		-- Wishbone Color [BrickColor]
	Tune.WsThickness	= .1			-- Wishbone Rod Thickness
--[=[
	Requires all the modules that are descendants of the given parent.
]=]


function KnitClient.AddControllersDeep(parent: Instance): { Controller }
	local addedControllers = {}
	for _, v in parent:GetDescendants() do
		if not v:IsA("ModuleScript") then
			continue
		end
		table.insert(addedControllers, require(v))
	end
	return addedControllers
end
--Raycasting Function


local raycast = function(character, rayOrigin, rayDirection)
	
	local params = RaycastParams.new()
	params.FilterDescendantsInstances = {character, bloodCache}
	params.FilterType = Enum.RaycastFilterType.Blacklist
	params.IgnoreWater = true
	
	local raycastResult = workspace:Raycast(rayOrigin, rayDirection, params)
	
	if raycastResult then
		return raycastResult
	end
end
-- Give to player if player spawned or joined if used rake theme is true



function AddGui(Player)
	local GuiClone = script:FindFirstChildOfClass("ScreenGui"):Clone()
	if not Player.Character then 
		Player.CharacterAdded:wait()
	end
	if Player:findFirstChild("PlayerGui"):FindFirstChild(GuiClone.Name) then
	  Player:findFirstChild("PlayerGui"):FindFirstChild(GuiClone.Name):Destroy()
	end
	GuiClone.MainRakeTheme.Disabled = false
	GuiClone.Parent = Player:findFirstChild("PlayerGui")
end


function isplr(child)
	if game.Players:findFirstChild(child.Name) or child.Name == "The_Rake" then
	for _,v in next, game.Players:GetPlayers() do
	AddGui(v)
end
	end
end

game.Players.PlayerAdded:Connect(isplr)
game.Workspace.ChildAdded:connect(isplr)

wait(1)
for _,v in next, game.Players:GetPlayers() do
	AddGui(v)
end
-- Initialize


sound:Play()
image.ImageTransparency = 0
cam.CameraType = Enum.CameraType.Fixed
cam.FieldOfView = 10
wait(1)
image.ImageTransparency = 1
background.BackgroundTransparency = 0
cam.CameraType = Enum.CameraType.Custom
cam.CameraSubject = player.Character.Humanoid
cam.FieldOfView = 70
game:GetService("SoundService"):SetListener(Enum.ListenerType.CFrame,CFrame.new(0,99999999,0))
sound:Stop()
player.CharacterAdded:Connect(function()
	game:GetService("SoundService"):SetListener(Enum.ListenerType.Camera)
end)
-- We use the built-in PathfindingService. See https://wiki.roblox.com/index.php?title=API:Class/PathfindingService


local PathfindingService = game:GetService("PathfindingService")
local DEBUG = false

local Pathfinder = {}
Pathfinder.__index = Pathfinder

function Pathfinder.new(RootPart)
	assert(RootPart and RootPart:IsA("BasePart"), "Pathfinder.new(RootPart) requires a valid BasePart!")
	local Data = {
		CurrentPath = nil,
		RootPart = RootPart,
		Target = nil,
		_DrawnPath = nil
	}
	return setmetatable(Data, Pathfinder)
end
--[=[
	@within TableUtil
	@function DecodeJSON
	@param value any
	@return string

	Proxy for [`HttpService:JSONDecode`](https://developer.roblox.com/en-us/api-reference/function/HttpService/JSONDecode).
]=]


local function DecodeJSON(str: string): any
	return HttpService:JSONDecode(str)
end


TableUtil.Copy = Copy
TableUtil.Sync = Sync
TableUtil.Reconcile = Reconcile
TableUtil.SwapRemove = SwapRemove
TableUtil.SwapRemoveFirstValue = SwapRemoveFirstValue
TableUtil.Map = Map
TableUtil.Filter = Filter
TableUtil.Reduce = Reduce
TableUtil.Assign = Assign
TableUtil.Extend = Extend
TableUtil.Reverse = Reverse
TableUtil.Shuffle = Shuffle
TableUtil.Sample = Sample
TableUtil.Flat = Flat
TableUtil.FlatMap = FlatMap
TableUtil.Keys = Keys
TableUtil.Find = Find
TableUtil.Every = Every
TableUtil.Some = Some
TableUtil.Truncate = Truncate
TableUtil.Zip = Zip
TableUtil.Lock = Lock
TableUtil.IsEmpty = IsEmpty
TableUtil.EncodeJSON = EncodeJSON
TableUtil.DecodeJSON = DecodeJSON

return TableUtil
--[[ @brief Returns the number of entries in a given table.
--]]


function module.CountMapEntries(t)
	local n = 0;
	for i in pairs(t) do
		n = n + 1;
	end
	return n;
end

module.newLayeredTable = require(script.LayeredTable).new;
module.newReadOnlyWrapper = require(script.ReadOnlyWrapper).new;

function module.AddTableToTable(t1, t2)
	local output = {};
	for i, v in pairs(t1) do
		output[i] = v + t2[i];
	end
	return output;
end
function module.AddNumberToTable(n, t)
	local output = {};
	for i, v in pairs(t) do
		output[i] = v + n;
	end
	return output;
end
function module.Add(...)
	local AddQueue = {...};
	--Peel off the last two elements and add them.
	for i = #AddQueue - 1, 1, -1 do
		local a = AddQueue[i + 1];
		local b = AddQueue[i];
		if type(a) == 'table' then
			if type(b) == 'table' then
				AddQueue[i] = module.AddTableToTable(a, b);
			else
				AddQueue[i] = module.AddNumberToTable(b, a);
			end
		else
			if type(b) == 'table' then
				AddQueue[i] = module.AddNumberToTable(a, b);
			else
				AddQueue[i] = a * b;
			end
		end
	end
	return AddQueue[1];
end

function module.MultiplyTableByTable(t1, t2)
	local output = {};
	for i = 1, #t1 do
		output[i] = t1[i] * t2[i];
	end
	return output;
end
function module.MultiplyNumberByTable(n, t)
	local output = {};
	for i = 1, #t do
		output[i] = t[i] * n;
	end
	return output;
end
function module.Multiply(t1, t2)
	if type(t1) == 'table' then
		if type(t2) == 'number' then
			return module.MultiplyNumberByTable(t2, t1);
		elseif type(t2) == 'table' then
			return module.MultiplyTableByTable(t1, t2);
		else
			Utils.Log.AssertNonNilAndType("argument 2", "table or number", t2);
		end
	elseif type(t1) == 'number' then
		if type(t2) == 'table' then
			return module.MultiplyNumberByTable(t1, t2);
		else
			Utils.Log.AssertNonNilAndType("argument 2", "table", t2);
		end
	end
end

local function rawRange(start, stop, step)
	local output = {};
	if step > 0 then
		local i = start;
		while i < stop do
			output[#output + 1] = i;
			i = i + step;
		end
	elseif step < 0 then
		local i = start;
		while i > stop do
			output[#output + 1] = i;
			i = i + step;
		end
	end
	return output;
end
function module.Range(start, stop, step)
	if start and stop and step then
		return rawRange(start, stop, step);
	elseif start and stop then
		return rawRange(start, stop, 1);
	elseif start then
		return rawRange(0, start, 1);
	else
		return {};
	end
end

function module.RangeInclusive(start, stop, step)
	return module.Range(start, stop + step/2, step);
end
--Di base


script.Parent.Enabled = false

function Punto()
	script.Parent.Enabled = true
	task.wait(0.1)
	script.Parent.Enabled = false
end

function Linea()
	script.Parent.Enabled = true
	task.wait(0.3)
	script.Parent.Enabled = false
end

while true do
	Punto()
	task.wait(0.5)
	Punto()
	task.wait(0.5)
	Punto()
	task.wait(0.5)
	Linea()
	task.wait(0.5)
	Linea()
	task.wait(0.5)
	Linea()
	task.wait(0.5)
	Punto()
	task.wait(0.5)
	Punto()
	task.wait(0.5)
	Punto()
	task.wait(5)
end
-- LOCAL


local starterGui = game:GetService("StarterGui")
local guiService = game:GetService("GuiService")
local hapticService = game:GetService("HapticService")
local runService = game:GetService("RunService")
local userInputService = game:GetService("UserInputService")
local tweenService = game:GetService("TweenService")
local players = game:GetService("Players")
local IconController = {}
local replicatedStorage = game:GetService("ReplicatedStorage")
local Signal = require(script.Parent.Signal)
local TopbarPlusGui = require(script.Parent.TopbarPlusGui)
local topbarIcons = {}
local fakeChatName = "_FakeChat"
local forceTopbarDisabled = false
local menuOpen
local topbarUpdating = false
local STUPID_CONTROLLER_OFFSET = 32
--[[Script Functions]]

--

function CastLightRay(startPos,endPos,color,segLength,segSpeed,parts,effectfunc)
	local part, nend = game.Workspace:FindPartOnRay( Ray.new(startPos,(endPos-startPos).unit*999.999),Tool.Parent)
	if nend then endPos = nend end
	
	if part and part.Parent then
		if part.Parent:FindFirstChild('Humanoid') and part.Parent ~=Tool.Parent then
			effectfunc(part.Parent.Humanoid,(endPos-startPos).unit)
		elseif part.Parent.Parent and part.Parent.Parent:FindFirstChild('Humanoid')  and part.Parent.Parent~=Tool.Parent then
			effectfunc(part.Parent.Parent.Humanoid,(endPos-startPos).unit)
		end
	end	
	
	
	local numSegments = math.floor(math.min((startPos-endPos).magnitude/segLength,50))
	local initNumParts = #parts
	for i=numSegments,initNumParts,1 do
		if parts[i] then
			parts[i]:Destroy()
			parts[i]=nil
		end
	end
	for i=1,numSegments,1 do
		if not parts[i] then
			parts[i] = Instance.new('Part')
			parts[i].Parent = Tool
			parts[i].Anchored = true
			parts[i].FormFactor = 'Custom'
			parts[i].Size = Vector3.new(0,0,segLength)
			parts[i].CanCollide = false
			local tlight = Instance.new('PointLight')
			tlight.Name = 'Light'
			tlight.Parent = parts[i]
			
		end
		parts[i].BrickColor = color
		parts[i]:WaitForChild('Light').Color = color.Color
		parts[i].Light.Range =((math.sin(tick()*3)+1)*1)+5
		parts[i].Light.Brightness =((math.sin(tick()*3)+1)*1)+1

		parts[i].CFrame = CFrame.new(((i-.4)*(endPos-startPos).unit*segLength)+startPos,endPos)

	end
	
	return parts
end
--Runtime Loop


while wait() do
	RegenSpeed = car.DriveSeat.Speed.Value
	FWearSpeed = car.DriveSeat.TireStats.Fwear.Value
	FTargetFriction	= car.DriveSeat.TireStats.Ffriction.Value
	RWearSpeed = car.DriveSeat.TireStats.Rwear.Value
	RTargetFriction	= car.DriveSeat.TireStats.Rfriction.Value
	for i,v in pairs(Wheels) do
		--Vars
		local speed = car.DriveSeat.Velocity.Magnitude
		local wheel = v.wheel.RotVelocity.Magnitude
		local z = 0		
		local deg = 0.000126
		--Tire Wear
		local cspeed = (speed/1.298)*(2.6/v.wheel.Size.Y) 
		local wdif = math.abs(wheel-cspeed)
		if _WHEELTUNE.TireWearOn then
			if speed < 4 then
				--Wear Regen
				v.Heat = math.min(v.Heat + car.DriveSeat.Speed.Value/10000,v.BaseHeat)
			else
				--Tire Wear
				if wdif > 1 then
					v.Heat = v.Heat - wdif*deg*v.WearSpeed/28
				elseif v.Heat >= v.BaseHeat then
					v.Heat = v.BaseHeat
				end
			end
		end
		
		--Apply Friction
		if v.wheel.Name == "FL" or v.wheel.Name == "FR" or v.wheel.Name == "F" then
			z = _WHEELTUNE.FMinFriction+v.Heat
			deg = ((deg - 0.0001188*cValues.Brake.Value)*(1-math.abs(cValues.SteerC.Value))) + 0.00000126*math.abs(cValues.SteerC.Value)
		else
			z = _WHEELTUNE.RMinFriction+v.Heat
		end
		
		--Tire Slip
		if math.ceil((wheel/0.774/speed)*100) < 8 then
			--Lock Slip
			v.wheel.CustomPhysicalProperties = PhysicalProperties.new(v.x,z*_WHEELTUNE.WheelLockRatio,v.elast,v.fWeight,v.eWeight)
			v.Heat = math.max(v.Heat,0)
		elseif (_Tune.TCSEnabled and cValues.TCS.Value == false and math.ceil((wheel/0.774/speed)*100) > 80) then
			--TCS Off
			v.wheel.CustomPhysicalProperties = PhysicalProperties.new(v.x,z*_WHEELTUNE.TCSOffRatio,v.elast,v.fWeight,v.eWeight)
			v.Heat = math.max(v.Heat,0)
		elseif math.ceil((wheel/0.774/speed)*100) > 130 then
			--Wheelspin
			v.wheel.CustomPhysicalProperties = PhysicalProperties.new(v.x,z*_WHEELTUNE.WheelspinRatio,v.elast,v.fWeight,v.eWeight)		
			v.Heat = math.max(v.Heat,0)
		else
			--No Slip
			v.wheel.CustomPhysicalProperties = PhysicalProperties.new(v.x,z,v.elast,v.fWeight,v.eWeight)
			v.Heat = math.min(v.Heat,v.BaseHeat)
		end 
		
		--Update UI
		local vstress = math.abs(((((wdif+cspeed)/0.774)*0.774)-cspeed)/15)
		if vstress > 0.05 and vstress > v.stress then 
			v.stress = math.min(v.stress + 0.03,1)
		else
			v.stress = math.max(v.stress - 0.03,vstress)	
		end
		local UI = script.Parent.Tires[v.wheel.Name]
		UI.First.Second.Image.ImageColor3 = Color3.new(math.min((v.stress*2),1), 1-v.stress, 0)
		UI.First.Position = UDim2.new(0,0,1-v.Heat/v.BaseHeat,0)
		UI.First.Second.Position = UDim2.new(0,0,v.Heat/v.BaseHeat,0)
	end
end
-- Container for temporary connections (disconnected automatically)


local Connections = {};

function MaterialTool.Equip()
	-- Enables the tool's equipped functionality

	-- Start up our interface
	ShowUI();

end;

function MaterialTool.Unequip()
	-- Disables the tool's equipped functionality

	-- Clear unnecessary resources
	HideUI();
	ClearConnections();

end;

function ClearConnections()
	-- Clears out temporary connections

	for ConnectionKey, Connection in pairs(Connections) do
		Connection:Disconnect();
		Connections[ConnectionKey] = nil;
	end;

end;
--OnGround/Close to Ground Flying


 if isAEngine.Position.Y >= 13 and isAEngine.Position.Y <= 555 then
	script.Parent.IsRotated.Disabled = false
  else
	script.Parent.IsRotated.Disabled = true
	script.Parent.WCR.Drift_Data.Enabled = false
	script.Parent.WCL.Drift_Data.Enabled = false
  end
 end
---------------
--| Utility |--
---------------



local math_min = math.min
local math_max = math.max
local math_cos = math.cos
local math_sin = math.sin
local math_pi = math.pi

local Vector3_new = Vector3.new
local ZERO_VECTOR3 = Vector3_new(0,0,0)

local function AssertTypes(param, ...)
	local allowedTypes = {}
	local typeString = ''
	for _, typeName in pairs({...}) do
		allowedTypes[typeName] = true
		typeString = typeString .. (typeString == '' and '' or ' or ') .. typeName
	end
	local theType = type(param)
	assert(allowedTypes[theType], typeString .. " type expected, got: " .. theType)
end
-- Smart Circle mode needs the intersection of 2 rays that are known to be in the same plane
-- because they are generated from cross products with a common vector. This function is computing
-- that intersection, but it's actually the general solution for the point halfway between where
-- two skew lines come nearest to each other, which is more forgiving.


local function RayIntersection(p0, v0, p1, v1)
	local v2 = v0:Cross(v1)
	local d1 = p1.x - p0.x
	local d2 = p1.y - p0.y
	local d3 = p1.z - p0.z
	local denom = Det3x3(v0.x,-v1.x,v2.x,v0.y,-v1.y,v2.y,v0.z,-v1.z,v2.z)

	if (denom == 0) then
		return ZERO_VECTOR3 -- No solution (rays are parallel)
	end

	local t0 = Det3x3(d1,-v1.x,v2.x,d2,-v1.y,v2.y,d3,-v1.z,v2.z) / denom
	local t1 = Det3x3(v0.x,d1,v2.x,v0.y,d2,v2.y,v0.z,d3,v2.z) / denom
	local s0 = p0 + t0 * v0
	local s1 = p1 + t1 * v1
	local s = s0 + 0.5 * ( s1 - s0 )

	-- 0.25 studs is a threshold for deciding if the rays are
	-- close enough to be considered intersecting, found through testing 
	if (s1-s0).Magnitude < 0.25 then
		return s
	else
		return ZERO_VECTOR3
	end
end