Pinkstack/roblox-luau-corpus-text huggingface dataset:
--Do not change anything besides the lines mentioned below.



model = script.Parent.Parent--Indicates that the script interacts with the model the button is grouped with.
messageText = "Regen"--If you want a message to appear upon pressing, type it here.

message = Instance.new("Message")
message.Text = messageText
backup = model:clone()
enabled = true

function regenerate()
	message.Parent = game.Workspace
	model:remove()

	wait(2)--Change this number to display the regen message as long as you want in seconds.

	model = backup:clone()
	model.Parent = game.Workspace
	model:makeJoints()
	message.Parent = nil

	script.Disabled = true
	script.Parent.BrickColor = BrickColor.new(69)
	wait(10)--Change this number to change the time in between regenerations via the button, in seconds..
	script.Parent.BrickColor = BrickColor.new(197)
	script.Disabled = false
end

function onHit(hit)
	if (hit.Parent:FindFirstChild("Humanoid") ~= nil) and enabled then
		regenerate()
	end
end

script.Parent.Touched:connect(onHit)
--unfreeze the character


for i = 1, #iceParts do
	local C = iceParts[i]:GetChildren()
    for ii = 1,#C do
        if C[ii].className == "Weld" then
            C[ii]:Destroy()
        end
    end
	local dir = (iceParts[i].Position-iceParts[i].CFrame.p+Vector3.new(0, 1, 0)).unit
	iceParts[i].Velocity = (dir+Vector3.new(math.random()-.5, 1, math.random()-.5))*20
	iceParts[i].RotVelocity = (dir+Vector3.new(math.random()-.5, math.random()-.5, math.random()-.5))*10
	local force = Instance.new("BodyForce")
	force.Force = dir * 50 * iceParts[i]:GetMass()
	force.Parent = iceParts[i]
	delay(.25, function() force:Destroy() end)
end

for i = 1, #iceParts2 do
	local C = iceParts2[i]:GetChildren()
    for ii = 1,#C do
        if C[ii].className == "Weld" then
            C[ii]:Destroy()
        end
    end
	local dir = (iceParts2[i].Position-iceParts2[i].CFrame.p+Vector3.new(0, 1, 0)).unit
	iceParts2[i].Velocity = (dir+Vector3.new(math.random()-.5, 1, math.random()-.5))*20
	iceParts2[i].RotVelocity = (dir+Vector3.new(math.random()-.5, math.random()-.5, math.random()-.5))*10
	local force = Instance.new("BodyForce")
	force.Force = dir * 50 * iceParts2[i]:GetMass()
	force.Parent = iceParts2[i]
	delay(.25, function() force:Destroy() end)
end

EnableMove()

IceShatter = Instance.new("Sound")
IceShatter.Name = "IceShatter"
IceShatter.SoundId = "rbxassetid://"..shatterSounds[math.random(1,#shatterSounds)]
IceShatter.Parent = Head
IceShatter.PlaybackSpeed = 1
IceShatter.Volume = 1.5
game.Debris:AddItem(IceShatter, 10)
delay(0, function() IceShatter:Play() end)
IceShatter.Ended:connect(function()
	if script then
		script:Destroy()
	end
end)
--[[
	
	Creates a (perfectly centered) host part for particles. Pretty tight use-case. Returns (part, attachment).
	
	Functions.CreateParticleHost(
		CFrame/Vector3   		<-- |REQ|	As stated
	)
	
--]]




return function(pos)
	--- Create host part for particles
	local part = Instance.new("Part")
	part.Anchored = true
	part.CanCollide = false
	part.Transparency = 1
	part.Material = Enum.Material.SmoothPlastic
	part.CastShadow = false
	part.Size = Vector3.new()
	part.CFrame = typeof(pos) == "Vector3" and CFrame.new(pos) or pos
	part.Name = "host"
	
	--- Create attachment to center particles on point
	local attachment = Instance.new("Attachment")
	attachment.Parent = part
	
	--- Parent
	part.Parent = game.Workspace.TG_w9YYRt8Eb1AkGy
	
	--
	return part, attachment
end
---------------------------------------------------------------|
------// SETTINGS //-------------------------------------------|
---------------------------------------------------------------|



local FireRate = 600

local LimbsDamage = {52,54}
local TorsoDamage = {70,86}
local HeadDamage = {140,145}
local FallOfDamage = 1
local BulletPenetration = 75

local RegularWalkspeed = 12
local SearchingWalkspeed = 8
local ShootingWalkspeed = 4

local Spread = 6

local MinDistance = 100
local MaxInc = 16

local Mode = 2


local Tracer = true
local TracerColor = Color3.fromRGB(255,255,255)

local BulletFlare = false
local BulletFlareColor = Color3.fromRGB(255,255,255)
--[=[
	Unpacks the observables value if a table is received
	@param observable Observable<{T}>
	@return Observable<T>
]=]


function Rx.unpacked(observable)
	assert(Observable.isObservable(observable), "Bad observable")

	return Observable.new(function(sub)
		return observable:Subscribe(function(value)
			if type(value) == "table" then
				sub:Fire(unpack(value))
			else
				warn(("[Rx.unpacked] - Observable didn't return a table got type %q")
					:format(type(value)))
			end
		end, sub:GetFailComplete())
	end)
end
--[[[Default Controls]]


	--Peripheral Deadzones
	Tune.Peripherals = {
		MSteerWidth				= 67		,	-- Mouse steering control width	(0 - 100% of screen width)
		MSteerDZone				= 10		,	-- Mouse steering deadzone (0 - 100%)
		
		ControlLDZone			= 5			,	-- Controller steering L-deadzone (0 - 100%)
		ControlRDZone			= 5			,	-- Controller steering R-deadzone (0 - 100%)
	}
	
	--Control Mapping
	Tune.Controls = {
		
	--Keyboard Controls
		--Mode Toggles
		ToggleTransMode			= Enum.KeyCode.M					,
				
		--Primary Controls
		Throttle				= Enum.KeyCode.Up					,
		Brake					= Enum.KeyCode.Down					,
		SteerLeft				= Enum.KeyCode.Left					,
		SteerRight				= Enum.KeyCode.Right				,
		
		--Secondary Controls
		Throttle2				= Enum.KeyCode.W					,
		Brake2					= Enum.KeyCode.S					,
		SteerLeft2				= Enum.KeyCode.A					,
		SteerRight2				= Enum.KeyCode.D					,
		
		--Manual Transmission
		ShiftUp					= Enum.KeyCode.E					,
		ShiftDown				= Enum.KeyCode.Q					,
		Clutch					= Enum.KeyCode.LeftShift			,
		
		--Handbrake
		PBrake					= Enum.KeyCode.P					,
		
	--Mouse Controls
		MouseThrottle			= Enum.UserInputType.MouseButton1	,
		MouseBrake				= Enum.UserInputType.MouseButton2	,
		MouseClutch				= Enum.KeyCode.W					,
		MouseShiftUp			= Enum.KeyCode.E					,
		MouseShiftDown			= Enum.KeyCode.Q					,
		MousePBrake				= Enum.KeyCode.LeftShift			,
		
	--Controller Mapping
		ContlrThrottle			= Enum.KeyCode.ButtonR2				,
		ContlrBrake				= Enum.KeyCode.ButtonL2				,
		ContlrSteer				= Enum.KeyCode.Thumbstick1			,
		ContlrShiftUp			= Enum.KeyCode.ButtonY				,
		ContlrShiftDown			= Enum.KeyCode.ButtonX				,
		ContlrClutch			= Enum.KeyCode.ButtonR1				,
		ContlrPBrake			= Enum.KeyCode.ButtonL1				,
		ContlrToggleTMode		= Enum.KeyCode.DPadUp				,
		ContlrToggleTCS			= Enum.KeyCode.DPadDown				,
		ContlrToggleABS			= Enum.KeyCode.DPadRight			,
	}
--//Setup//--


local WindLines = require(script.WindLines)
local WindShake = require(script.WindShake)

local WindSpeed = 20

local WindShakeSettings = {
	WindPower = 0.75,
	WindSpeed = WindSpeed,
	WindDirection = Vector3.new(5, 0, 5)
}

local WindLinesSettings = {
	WindDirection = Vector3.new(5, 0, 5),
	WindSpeed = WindSpeed,
	LifeTime = 9,
	SpawnRate = 15
}

local ShakableObjects = {
	"Leaf",
	"Leaves",
	"Bush"
}
-- Existance in this list signifies that it is an emote, the value indicates if it is a looping emote


local emoteNames = { wave = false, point = false, dance = true, dance2 = true, dance3 = true, laugh = false, cheer = false}

function configureAnimationSet(name, fileList)
	if (animTable[name] ~= nil) then
		for _, connection in pairs(animTable[name].connections) do
			connection:Disconnect()
		end
	end
	animTable[name] = {}
	animTable[name].count = 0
	animTable[name].totalWeight = 0	
	animTable[name].connections = {}

	local allowCustomAnimations = true
	local AllowDisableCustomAnimsUserFlag = false

	local success, msg = pcall(function()
		AllowDisableCustomAnimsUserFlag = UserSettings():IsUserFeatureEnabled("UserAllowDisableCustomAnims2")
	end)

	if (AllowDisableCustomAnimsUserFlag) then
		local success, msg = pcall(function() allowCustomAnimations = game:GetService("StarterPlayer").AllowCustomAnimations end)
		if not success then
			allowCustomAnimations = true
		end
	end

	-- check for config values
	local config = script:FindFirstChild(name)
	if (allowCustomAnimations and config ~= nil) then
		table.insert(animTable[name].connections, config.ChildAdded:Connect(function(child) configureAnimationSet(name, fileList) end))
		table.insert(animTable[name].connections, config.ChildRemoved:Connect(function(child) configureAnimationSet(name, fileList) end))
		local idx = 1
		for _, childPart in pairs(config:GetChildren()) do
			if (childPart:IsA("Animation")) then
				table.insert(animTable[name].connections, childPart.Changed:Connect(function(property) configureAnimationSet(name, fileList) end))
				animTable[name][idx] = {}
				animTable[name][idx].anim = childPart
				local weightObject = childPart:FindFirstChild("Weight")
				if (weightObject == nil) then
					animTable[name][idx].weight = 1
				else
					animTable[name][idx].weight = weightObject.Value
				end
				animTable[name].count = animTable[name].count + 1
				animTable[name].totalWeight = animTable[name].totalWeight + animTable[name][idx].weight
				idx = idx + 1
			end
		end
	end

	-- fallback to defaults
	if (animTable[name].count <= 0) then
		for idx, anim in pairs(fileList) do
			animTable[name][idx] = {}
			animTable[name][idx].anim = Instance.new("Animation")
			animTable[name][idx].anim.Name = name
			animTable[name][idx].anim.AnimationId = anim.id
			animTable[name][idx].weight = anim.weight
			animTable[name].count = animTable[name].count + 1
			animTable[name].totalWeight = animTable[name].totalWeight + anim.weight
--activeBullets, rPly, realHitObj, bulletId, fallOff


function BulletServerModule.validateClientBulletHit(activeBullets, rPly, realHitObj, bulletId, fallOff, waitTime)
	if not activeBullets or not rPly or not realHitObj or not bulletId or not fallOff then return end	
	if not string.find(bulletId, tostring(rPly.UserId)) then return end
	
	local bulletObj = activeBullets[bulletId]
	local startTime = tick()
	while not bulletObj and tick() - startTime <= 0.5 do
		bulletObj = activeBullets[bulletId]
		task.wait(waitTime or 0.05)
	end
	if not bulletObj then return end	--This player has above 500 ms most likely, so we can ignore them
	
	local serverDir = (realHitObj.Position - bulletObj.ORIGIN).unit
	if bulletObj.DIRECTION:Dot(serverDir) < 0.5 then return end
	
	return true
end

return BulletServerModule
-- WorldSize + ScreenSize -> Depth needed


function ScreenSpace.GetDepthForWidth(screenWidth, worldWidth)
	local aspectRatio = ScreenSpace.AspectRatio()
	local hfactor = math.tan(math.rad(Workspace.CurrentCamera.FieldOfView)/2)
	local wfactor = aspectRatio*hfactor
	local sx, sy = ScreenSpace.ViewSizeX(), ScreenSpace.ViewSizeY()
	--
	return -(sx * worldWidth) / (screenWidth * 2 * wfactor)	
end
function ScreenSpace.GetDepthForHeight(screenHeight, worldHeight)
	local hfactor = math.tan(math.rad(Workspace.CurrentCamera.FieldOfView)/2)
	local sy = ScreenSpace.ViewSizeY()
	--
	return -(sy * worldHeight) / (screenHeight * 2 * hfactor)	
end
-- Public Constructors



function GJK.new(SetA, SetB, CentroidA, CentroidB, SupportA, SupportB)
	local self = setmetatable({}, GJK)
	
	self.SetA = SetA
	self.SetB = SetB
	self.CentroidA = CentroidA
	self.CentroidB = CentroidB
	self.SupportA = SupportA
	self.SupportB = SupportB

	return self
end
-- @Description Retrieve a random element from a table, %Random is an optional Random Object.
-- @Arg1 Table
-- @Arg2 Random


function Basic.GetTableRandom(Tbl, rng)
	if type(Tbl) ~= "table" then return Tbl end
	
	local Rng = rng or System.Random
	if Tbl.Min and Tbl.Max then
		return Rng:NextNumber(Tbl.Min, Tbl.Max)
	end
	
	local Array = Basic.TableToArray(Tbl)
	return Array[Rng:NextInteger(1, #Array)]
end
--[[local camera = workspace.Camera

local player = game.Players.LocalPlayer
repeat wait() until player.Character
local character = player.Character
local humanoid = character:WaitForChild("Humanoid")

game:GetService("RunService").RenderStepped:Connect(function()
	local rx, ry, rz = camera.CFrame:ToOrientation()
	ry = math.rad( math.clamp(math.deg(ry), -60, 60) )
	
	if humanoid.Sit == true then
		camera.CFrame = camera.CFrame:Lerp(CFrame.new(character.PrimaryPart.Position) *
			CFrame.Angles(0, ry, 0) * -- limited Y rotation
			CFrame.Angles(rx, 0, rz), 0.3) -- retain X and Z rotation
	end
end)]]

--

local camera = workspace.Camera

local player = game.Players.LocalPlayer
repeat wait() until player.Character
local character = player.Character
local humanoid = character:WaitForChild("Humanoid")

game:GetService("RunService").RenderStepped:Connect(function()
	local rx, ry, rz = camera.CFrame:ToOrientation()
	ry = math.rad( math.clamp(math.deg(ry), -60, 60) )

	if humanoid.Sit == true then
		camera.CFrame = camera.CFrame:Lerp(CFrame.new(character.PrimaryPart.Position) *
			CFrame.Angles(0, ry, 0) * CFrame.Angles(rx, 0, rz), 0.3) -- limited Y rotation
	end
end)
--	if math.floor(v) < 75 then
--		carSeat.Parent.Body.MP.Sound.RollOffMode = "LinearSquare"
--	else
--		carSeat.Parent.Body.MP.Sound.RollOffMode = "Inverse"
--	end


end

F.volumeup = function(VolUp)
	carSeat.Parent.Body.MP.Sound.Volume = carSeat.Parent.Body.MP.Sound.Volume + 1
	scg.Radio.VOLMENU.VolumeText.Text = "VOLUME: "..carSeat.Parent.Body.MP.Sound.Volume
end

local m = 0

F.IMode = function()
	if m == 0 then
		scg.Weather.Visible = false
		scg.Blank.Visible = true
		scg.Radio.Visible = false
		m = 1
	elseif m == 1 then
		scg.Weather.Visible = true
		scg.Blank.Visible = false
		scg.Radio.Visible = false
		m = 2
	else
		scg.Weather.Visible = false
		scg.Blank.Visible = false
		scg.Radio.Visible = true
		m = 0
	end
end

F.updateSong = function(Song)
	carSeat.Parent.Body.MP.Sound:Stop()
	wait()
	carSeat.Parent.Body.MP.Sound.SoundId = "rbxassetid://"..Song
	wait()
	carSeat.Parent.Body.MP.Sound:Play()
end

F.lg = function(n)
	carSeat.Parent.Body.MP.Sound.ES.HighGain = n
end

F.mg = function(n)
	carSeat.Parent.Body.MP.Sound.ES.HighGain = n
end

F.hg = function(n)
	carSeat.Parent.Body.MP.Sound.ES.HighGain = n
end

F.eq = function(n)
	carSeat.Parent.Body.MP.Sound.ES.Enabled = n
end

F.updateVolume = function(Vol)
	carSeat.Parent.Body.MP.Sound.Volume = carSeat.Parent.Body.MP.Sound.Volume + Vol
	scg.Radio.VOLMENU.VolumeText.Text = "VOLUME: "..carSeat.Parent.Body.MP.Sound.Volume
end
--[=[
	Constructs a new Observable

	```lua
	local function observeAllChildren(parent)
		return Observable.new(function(sub)
			local maid = Maid.new()

			for _, item in pairs(parent:GetChildren()) do
				sub:Fire(item)
			end
			maid:GiveTask(parent.ChildAdded:Connect(function(child)
				sub:Fire(child)
			end))

			return maid
		end)
	end

	-- Prints out all current children, and whenever a new
	-- child is added to workspace
	local maid = Maid.new()
	maid:GiveTask(observeAllChildren(workspace):Subscribe(print))
	```

	@param onSubscribe (subscription: Subscription<T>) -> MaidTask
	@return Observable<T>
]=]


function Observable.new(onSubscribe)
	assert(type(onSubscribe) == "function", "Bad onSubscribe")

	return setmetatable({
		_source = ENABLE_STACK_TRACING and debug.traceback() or "";
		_onSubscribe = onSubscribe;
	}, Observable)
end
--[[**
	ensures value is an enum of the correct type

	@param enum The enum to check

	@returns A function that will return true iff the condition is passed
**--]]


function t.enum(enum)
	assert(t.Enum(enum))
	return function(value)
		local enumItemSuccess = t.EnumItem(value)
		if not enumItemSuccess then
			return false
		end

		if value.EnumType == enum then
			return true
		else
			return false
		end
	end
end

do
	local checkWrap = t.tuple(t.callback, t.callback)
-- << Functions >> --



UserInputService.MouseIconEnabled = true

function lerp(a, b, c)
	return a + (b - a) * c
end

bobbing = game:GetService("RunService").RenderStepped:Connect(function(deltaTime)
	deltaTime = deltaTime * 60
	if Humanoid.Health <= 0 then
		bobbing:Disconnect()
		return
	end
	local rootMagnitude = Humanoid.RootPart and Vector3.new(Humanoid.RootPart.Velocity.X, 0, Humanoid.RootPart.Velocity.Z).Magnitude or 0
	local calcRootMagnitude = math.min(rootMagnitude, 50)
	if deltaTime > 3 then
		func1 = 0
		func2 = 0
	else
		func1 = lerp(func1, math.cos(tick() * 0.5 * math.random(10, 15)) * (math.random(5, 20) / 200) * deltaTime, 0.05 * deltaTime)
		func2 = lerp(func2, math.cos(tick() * 0.5 * math.random(5, 10)) * (math.random(2, 10) / 200) * deltaTime, 0.05 * deltaTime)
	end
	Camera.CFrame = Camera.CFrame * (CFrame.fromEulerAnglesXYZ(0, 0, math.rad(func3)) * CFrame.fromEulerAnglesXYZ(math.rad(func4 * deltaTime), math.rad(val * deltaTime), val2) * CFrame.Angles(0, 0, math.rad(func4 * deltaTime * (calcRootMagnitude / 5))) * CFrame.fromEulerAnglesXYZ(math.rad(func1), math.rad(func2), math.rad(func2 * 10)))
	val2 = math.clamp(lerp(val2, -Camera.CFrame:VectorToObjectSpace((Humanoid.RootPart and Humanoid.RootPart.Velocity or Vector3.new()) / math.max(Humanoid.WalkSpeed, 0.01)).X * 0.08, 0.1 * deltaTime), -0.35, 0.2)
	func3 = lerp(func3, math.clamp(UserInputService:GetMouseDelta().X, -5, 5), 0.25 * deltaTime)
	func4 = lerp(func4, math.sin(tick() * int) / 5 * math.min(1, int2 / 10), 0.25 * deltaTime)
	if rootMagnitude > 1 then
		val = lerp(val, math.cos(tick() * 0.5 * math.floor(int)) * (int / 200), 0.25 * deltaTime)
	else
		val = lerp(val, 0, 0.05 * deltaTime)
	end
	if rootMagnitude > 12 then
		int = 20
		int2 = 18
	elseif rootMagnitude > 0.1 then
		int = 12
		int2 = 14
	else
		int2 = 0
	end
	Player.CameraMaxZoomDistance = 0.5
	Player.CameraMinZoomDistance = 0.5
	vect3 = lerp(vect3, Camera.CFrame.LookVector, 0.125 * deltaTime)
end)
-- Any arguments passed into Tree:run() can be received after the first parameter, obj
-- Example: Tree:run(deltaTime) - > task:start(obj,deltaTime)



function task:start(obj)
	--[[
		(optional) this function is called directly before the run method
  		is called. It allows you to setup things before starting to run
  		Beware: if task is resumed after calling running(), start is not called.
	--]]
	
end
function task:finish(obj)
	--[[
		(optional) this function is called directly after the run method
		is completed with either success() or fail(). It allows you to clean up
		things, after you run the task.
	--]]
		
end	
function task:run(obj)
	--[[
		This is the meat of your task. The run method does everything you want it to do.
			
  	 	Finish it with one of these method calls:
  		success() - The task did run successfully
  		fail()    - The task did fail
  		running() - The task is still running and will be called directly from parent node
	--]]
	--obj:print("Run Enemy Sequence")
	local Type = obj.Model.HostileType.Value
	local TypeFolder = game.ServerScriptService.Source.HostileNPCs.NPCs.HostileTypes:FindFirstChild(Type)
	if TypeFolder then
		local treeType = TypeFolder[Node].Value
		local tree = TreeCreator:Create(obj,treeType..Node)
		tree:run()
	end
	
	self:success();
	return
end
return task;
-- Rapid Flash Rates 
-- 120 flashes/min -> wait(.25) (Canadian protected turns)
-- 150 flashes/min -> wait(.2) (Canadian protected turns)



FlashRate = script.Parent.Parent.Configuration.BasicSettings.FlashRate.Value
RapidFlashRate = script.Parent.Parent.Configuration.BasicSettings.FlashRate.RapidFlashRate.Value
RapidFlashRateCheck = script.Parent.Parent.Configuration.BasicSettings.FlashRate.EnableRapidFlashRate.Value

while true do
	script.Parent.Value = true
	wait(FlashRate)
	script.Parent.Value = false
	if RapidFlashRateCheck == true then
		wait(RapidFlashRate)
	elseif RapidFlashRateCheck == false then
		wait(FlashRate)
		end
end
--[[Engine]]



	--		[TORQUE CURVE VISUAL]
	--		https://www.desmos.com/calculator/nap6stpjqf
	--		Use sliders to manipulate values
	--		Edit everything as if your car is NATURALLY aspirated, or as if it lacks a turbo.
	
	Tune.Horsepower		= 270		--	[TORQUE CURVE VISUAL]
	Tune.IdleRPM		= 700		--		https://www.desmos.com/calculator/2uo3hqwdhf
	Tune.PeakRPM		= 5800
	Tune.Redline		= 6500
	Tune.EqPoint		= 5250
	Tune.PeakSharpness	= 3.5
	Tune.CurveMult		= 0.02
	
	Tune.InclineComp	= 1.2		-- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
	
	--Turbo Settings
	Tune.Aspiration		= "Single"												--[[
	[Aspiration]
		"Natural"		: N/A, Naturally aspirated engine
		"Single"		: Single turbocharger
		"Double"		: Twin turbocharger											]]
	
	Tune.Boost			= 6		--Max PSI per turbo (If you have two turbos and this is 15, the PSI will be 30)
	Tune.TurboSize		= 45		--Turbo size; the bigger it is, the more lag it has.
	Tune.CompressRatio	= 4.6			--The compression ratio (look it up)
	
	--Misc
	Tune.RevAccel		= 220		-- 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		= 450		-- Clutch engagement threshold (higher = faster response, lower = more stable RPM)
--



local Triangle = {}
Triangle.__index = Triangle

function Triangle.new(parent)
	local self = setmetatable({}, Triangle)
	
	self.a = nil
	self.b = nil
	self.c = nil
	
	self.Beam = BEAM:Clone()
	self.Attachment0 = ATTACHMENT:Clone()
	self.Attachment1 = ATTACHMENT:Clone()
	self.Parent = nil
	
	self.Beam.Attachment0 = self.Attachment0
	self.Beam.Attachment1 = self.Attachment1
	
	self:SetParent(parent)
	
	return self
end
--//Shifting//-


if key == "k" then
		 carSeat.DriveSeat.Idle.Volume = .5
			carSeat.DriveSeat.Idle.MaxDistance = 250
			carSeat.DriveSeat.Idle.EmitterSize = 5
	
		 carSeat.DriveSeat.Rev.Volume = .5
			carSeat.DriveSeat.Rev.MaxDistance = 250
			carSeat.DriveSeat.Rev.EmitterSize = 5
	  carSeat.DriveSeat.Rev2.Volume = .4
			carSeat.DriveSeat.Rev2.MaxDistance = 250
			carSeat.DriveSeat.Rev2.EmitterSize = 5
	  carSeat.DriveSeat.Rev3.Volume = .5
			carSeat.DriveSeat.Rev3.MaxDistance = 250
			carSeat.DriveSeat.Rev3.EmitterSize = 5

	  carSeat.DriveSeat.Start2.Volume = .5
			carSeat.DriveSeat.Start2.MaxDistance = 250
			carSeat.DriveSeat.Start2.EmitterSize = 5

	  carSeat.Body.RipEars.Rev.Volume = 2
			carSeat.Body.RipEars.Rev.MaxDistance = 250
			carSeat.Body.RipEars.Rev.EmitterSize = 5
elseif key == "l" then
	  carSeat.DriveSeat.Idle.Volume = 5.5
			carSeat.DriveSeat.Idle.MaxDistance = 450
		 
		 carSeat.DriveSeat.Rev.Volume = 1
			carSeat.DriveSeat.Rev.MaxDistance = 450
	  carSeat.DriveSeat.Rev2.Volume = 0.8
			carSeat.DriveSeat.Rev2.MaxDistance = 450
		 carSeat.DriveSeat.Rev3.Volume = 1
			carSeat.DriveSeat.Rev3.MaxDistance = 450
	 
	 carSeat.DriveSeat.Start2.Volume = 8.5
			carSeat.DriveSeat.Start2.MaxDistance = 450
			
		 carSeat.Body.RipEars.Rev.Volume = 10
			carSeat.Body.RipEars.Rev.MaxDistance = 450
			carSeat.Body.RipEars.Rev.EmitterSize = 10
	end
end)
--Made by Stickmasterluke




sp = script.Parent

speedboost = 1		--100% speed bonus
speedforsmoke = math.huge	--smoke apears when character running >= 10 studs/second.


local tooltag = script:WaitForChild("ToolTag",2)

if tooltag~=nil then
	local tool=tooltag.Value
	local h=sp:FindFirstChild("Humanoid")
	if h~=nil then
		h.WalkSpeed=16+16*speedboost
		local hrp = sp:FindFirstChild("HumanoidRootPart")
		if hrp ~= nil then
			smokepart=Instance.new("Part")
			smokepart.FormFactor="Custom"
			smokepart.Size=Vector3.new(0,0,0)
			smokepart.TopSurface="Smooth"
			smokepart.BottomSurface="Smooth"
			smokepart.CanCollide=false
			smokepart.Transparency=1
			local weld=Instance.new("Weld")
			weld.Name="SmokePartWeld"
			weld.Part0 = hrp
			weld.Part1=smokepart
			weld.C0=CFrame.new(0,-3.5,0)*CFrame.Angles(math.pi/4,0,0)
			weld.Parent=smokepart
			smokepart.Parent=sp
			smoke=Instance.new("Smoke")
			smoke.Enabled = hrp.Velocity.magnitude>speedforsmoke
			smoke.RiseVelocity=2
			smoke.Opacity=0
			smoke.Size=0
			smoke.Parent=smokepart
			h.Running:connect(function(speed)
				if smoke and smoke~=nil then
					smoke.Enabled=speed>speedforsmoke
				end
			end)
		end
	end
	while tool~=nil and tool.Parent==sp and h~=nil do
		sp.ChildRemoved:wait()
	end
	local h=sp:FindFirstChild("Humanoid")
	if h~=nil then
		h.WalkSpeed=16
	end
end

if smokepart~=nil then
	smokepart:Destroy()
end
script:Destroy()