Pinkstack/roblox-luau-corpus-text huggingface dataset:
--[[
	Constructs a new Promise with the given initializing callback.

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

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

	For example:

		local function get(url)
			return Promise.new(function(resolve, reject)
				spawn(function()
					resolve(HttpService:GetAsync(url))
				end)
			end)
		end

		get("https://google.com")
			:andThen(function(stuff)
				print("Got some stuff!", stuff)
			end)
]]


function Promise.new(callback)
	local promise = {
		-- Used to locate where a promise was created
		_source = debug.traceback(),

		-- A tag to identify us as a promise
		_type = "Promise",

		_status = Promise.Status.Started,

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

		-- If an error occurs with no observers, this will be set.
		_unhandledRejection = false,

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

	setmetatable(promise, Promise)

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

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

	local ok, err = wpcall(callback, resolve, reject)

	if not ok and promise._status == Promise.Status.Started then
		reject(err)
	end

	return promise
end
--[=[
	Yields the current thread until the given Promise completes. Returns the values that the promise resolved with.

	```lua
	local worked = pcall(function()
		print("got", getTheValue():expect())
	end)

	if not worked then
		warn("it failed")
	end
	```

	This is essentially sugar for:

	```lua
	select(2, assert(promise:await()))
	```

	**Errors** if the Promise rejects or gets cancelled.

	@error any -- Errors with the rejection value if this Promise rejects or gets cancelled.
	@yields
	@return ...any -- The values the Promise resolved with.
]=]


function Promise.prototype:expect()
	return expectHelper(self:awaitStatus())
end
------//Low Ready Animations


self.RightLowReady = CFrame.new(-.9, 1.25, 0) * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0));
self.LeftLowReady = CFrame.new(1,1,-0.6) * CFrame.Angles(math.rad(-45),math.rad(15),math.rad(-25));

self.RightElbowLowReady = CFrame.new(0,-0.45,-.25) * CFrame.Angles(math.rad(-80), math.rad(0), math.rad(0));
self.LeftElbowLowReady = CFrame.new(0,0,0)  * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0));

self.RightWristLowReady = CFrame.new(0,0,0.15) * CFrame.Angles(math.rad(20), math.rad(0), math.rad(0));
self.LeftWristLowReady = CFrame.new(0,0,0)  * CFrame.Angles(math.rad(0), math.rad(0), math.rad(0));
-- connect events



Humanoid.Died:connect(onDied)
Humanoid.Running:connect(onRunning)
Humanoid.Jumping:connect(onJumping)
Humanoid.Climbing:connect(onClimbing)
Humanoid.GettingUp:connect(onGettingUp)
Humanoid.FreeFalling:connect(onFreeFall)
Humanoid.FallingDown:connect(onFallingDown)
Humanoid.Seated:connect(onSeated)
--Weld stuff here



MakeWeld(car.Misc.Wheel.W,car.DriveSeat,"Motor").Name="W"
ModelWeld(misc.Wheel.Parts,misc.Wheel.W)

MakeWeld(misc.Popups.Hinge, car.DriveSeat,"Motor",.1)
ModelWeld(misc.Popups.Parts, misc.Popups.Hinge)
---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- 



function updatechar()
	
	for _, v in pairs(character:GetChildren())do
		if CanViewBody then
			if v.Name == 'Head' then
				v.LocalTransparencyModifier = 1
				v.CanCollide = false
				v.face.LocalTransparencyModifier = 1
			end
		else
			if v:IsA'Part' or v:IsA'UnionOperation' or v:IsA'MeshPart' then
				v.LocalTransparencyModifier = 1
				v.CanCollide = false
			end
		end
		if v:IsA'Accessory' then
			v:FindFirstChild('Handle').LocalTransparencyModifier = 1
			v:FindFirstChild('Handle').CanCollide = false
		end
		if v:IsA'Hat' then
			v:FindFirstChild('Handle').LocalTransparencyModifier = 1
			v:FindFirstChild('Handle').CanCollide = false
		end

	end
	
end
--Don't modify this script unless you really know what you're doing.



local WaitFor = (function(parent, child_name)
	local found = parent:FindFirstChild(child_name)
	while found == nil do
		parent.ChildAdded:wait()
		found = parent:FindFirstChild(child_name)
		if found then break end
	end
	return found
end)

local last = { neckC1 = nil, rshoC0 = nil, lshoC0 = nil, rhipC0 = nil, lhipC0 = nil }

local ApplyModifications = (function(weld, char)
	local torso = WaitFor(char, "Torso")
	local neck = WaitFor(torso, "Neck")
	local rsho = WaitFor(torso, "Right Shoulder")
	local lsho = WaitFor(torso, "Left Shoulder")
	local rhip = WaitFor(torso, "Right Hip")
	local lhip = WaitFor(torso, "Left Hip")

	local config = script.Parent.Configuration
	local head_ang = config["Head Angle"].Value
	local legs_ang = config["Legs Angle"].Value
	local arms_ang = config["Arms Angle"].Value
	local sit_ang  = config["Sitting Angle"].Value
	local sit_pos  = config["Sitting Position"].Value

	--First adjust sitting position and angle
	--Add 90 to the angle because that's what most people will be expecting.
	weld.C1 = weld.C1 * CFrame.fromEulerAnglesXYZ(math.rad((sit_ang) + 90), 0, 0)
	
	weld.C0 = CFrame.new(sit_pos)

	last.neckC1 = neck.C1
	last.rshoC0 = rsho.C0
	last.lshoC0 = lsho.C0
	last.rhipC0 = rhip.C0
	last.lhipC0 = lhip.C0

	--Now adjust the neck angle.
	neck.C1 = neck.C1 * CFrame.fromEulerAnglesXYZ(math.rad(head_ang), 0, 0)
	

	--Now adjust the arms angle.
	rsho.C0 = rsho.C0 * CFrame.fromEulerAnglesXYZ(math.rad(0), math.rad(0), math.rad(arms_ang))
	lsho.C0 = lsho.C0 * CFrame.fromEulerAnglesXYZ(math.rad(0), math.rad(0), math.rad(-arms_ang))
	

	--Now the legs
	rhip.C0 = rhip.C0 * CFrame.fromEulerAnglesXYZ(math.rad(0), math.rad(0), math.rad(legs_ang))
	lhip.C0 = lhip.C0 * CFrame.fromEulerAnglesXYZ(math.rad(0), math.rad(0), math.rad(-legs_ang))
end)

local RevertModifications = (function(weld, char)
	--Any modifications done in ApplyModifications have to be reverted here if they
	--change any welds - otherwise people will wonder why their head is pointing the wrong way.

	local torso = WaitFor(char, "Torso")
	local neck = WaitFor(torso, "Neck")
	local rsho = WaitFor(torso, "Right Shoulder")
	local lsho = WaitFor(torso, "Left Shoulder")
	local rhip = WaitFor(torso, "Right Hip")
	local lhip = WaitFor(torso, "Left Hip")


	--Now adjust the neck angle.
	neck.C1 = last.neckC1 or CFrame.new()

	rsho.C0 = last.rshoC0 or CFrame.new()
	lsho.C0 = last.lshoC0 or CFrame.new()

	rhip.C0 = last.rhipC0 or CFrame.new()
	lhip.C0 = last.lhipC0 or CFrame.new()

	weld:Destroy()
end)

script.Parent.ChildAdded:connect(function(c)
	if c:IsA("Weld") then
		local character = nil
		if c.Part1 ~= nil and c.Part1.Parent ~= nil and c.Part1.Parent:FindFirstChild("Humanoid") ~= nil then
			character = c.Part1.Parent
		else return end
		ApplyModifications(c, character)
	end
end)

script.Parent.ChildRemoved:connect(function(c)
	if c:IsA("Weld") then
		local character = nil
		if c.Part1 ~= nil and c.Part1.Parent ~= nil and c.Part1.Parent:FindFirstChild("Humanoid") ~= nil then
			character = c.Part1.Parent
		else return end
		RevertModifications(c, character)
	end
end)
---[[ Fade Out and In Settings ]]


module.ChatWindowBackgroundFadeOutTime = 3.5 --Chat background will fade out after this many seconds.
module.ChatWindowTextFadeOutTime = 30 --Chat text will fade out after this many seconds.
module.ChatDefaultFadeDuration = 0.8
module.ChatShouldFadeInFromNewInformation = false
module.ChatAnimationFPS = 20.0
--Turbo Gauge GUI--



local fix = 0


function Gauge()
	
	script.Parent.BAnalog.Visible = BoostGaugeVisible
	script.Parent.Background.Visible = BoostGaugeVisible
	script.Parent.DontTouch.Visible = BoostGaugeVisible
	script.Parent.Num.Visible = BoostGaugeVisible
	
	
	local turbo = ((totalPSI/2)*WasteGatePressure)
	local turbo2 = WasteGatePressure
	
	fix =  -turbo2 + turbo*2
	
	script.Parent.BAnalog.Rotation= 110 + (totalPSI/2)*220
	
	
script.Parent.Num.N1.TextLabel.Text = (math.floor(WasteGatePressure*(4/4)))*TurboCount
script.Parent.Num.N2.TextLabel.Text = (math.floor(WasteGatePressure*(3/4)))*TurboCount
script.Parent.Num.N3.TextLabel.Text = (math.floor(WasteGatePressure*(2/4)))*TurboCount
script.Parent.Num.N4.TextLabel.Text = (math.floor(WasteGatePressure*(1/4)))*TurboCount
script.Parent.Num.N5.TextLabel.Text = 0
script.Parent.Num.N6.TextLabel.Text = -5


end
--This local script will run only for the player whos character it is in. It's changes to the sounds will replicate as they are changes to the character.
-- util



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
--[=[
	@param defaultFn () -> any
	@return value: any
	If the option holds a value, returns the value. Otherwise, returns the
	result of the `defaultFn` function.
]=]


function Option:UnwrapOrElse(defaultFn)
	if self:IsSome() then
		return self:Unwrap()
	else
		return defaultFn()
	end
end
--[[ icon_controller:header
## Functions

#### setGameTheme
```lua
IconController.setGameTheme(theme)
```
Sets the default theme which is applied to all existing and future icons.

----
#### setDisplayOrder
```lua
IconController.setDisplayOrder(number)
```
Changes the DisplayOrder of the TopbarPlus ScreenGui to the given value.

----
#### setTopbarEnabled
```lua
IconController.setTopbarEnabled(bool)
```
When set to ``false``, hides all icons created with TopbarPlus. This can also be achieved by calling ``starterGui:SetCore("TopbarEnabled", false)``.

----
#### setGap
```lua
IconController.setGap(integer, alignment)
```
Defines the offset width (i.e. gap) between each icon for the given alignment, ``left``, ``mid``, ``right``, or all alignments if not specified. 

----
#### setLeftOffset
```lua
IconController.setLeftOffset(integer)
```
Defines the offset from the left side of the screen to the nearest left-set icon. 

----
#### setRightOffset
```lua
IconController.setRightOffset(integer)
```
Defines the offset from the right side of the screen to the nearest right-set icon. 

----
#### updateTopbar
```lua
IconController.updateTopbar()
```
Determines how icons should be positioned on the topbar and moves them accordingly.  

----
#### clearIconOnSpawn
```lua
IconController.clearIconOnSpawn(icon)
```
Calls destroy on the given icon when the player respawns. This is useful for scenarious where you wish to cleanup icons that are constructed within a Gui with ``ResetOnSpawn`` set to ``true``. For example:

```lua
-- Place at the bottom of your icon creator localscript
local icons = IconController.getIcons()
for _, icon in pairs(icons) do
	IconController.clearIconOnSpawn(icon)
end
```

----
#### getIcons
```lua
local arrayOfIcons = IconController.getIcons()
```
Returns all icons as an array.

----
#### getIcon
```lua
local icon = IconController.getIcon(name)
```
Returns the icon with the given name (or ``false`` if not found). If multiple icons have the same name, then one will be returned randomly.

----
#### disableHealthbar
```lua
IconController.disableHealthbar(bool)
```
Hides the fake healthbar (if currently visible) and prevents it becoming visible again (which normally occurs when the player takes damage).

----



## Properties
#### mimicCoreGui
```lua
local bool = IconController.mimicCoreGui --[default: 'true']
```
Set to ``false`` to have the topbar persist even when ``game:GetService("StarterGui"):SetCore("TopbarEnabled", false)`` is called.

----
#### controllerModeEnabled
{read-only}
```lua
local bool = IconController.controllerModeEnabled
```

----
#### leftGap
{read-only}
```lua
local gapNumber = IconController.leftGap --[default: '12']
```

----
#### midGap
{read-only}
```lua
local gapNumber = IconController.midGap --[default: '12']
```

----
#### rightGap
{read-only}
```lua
local gapNumber = IconController.rightGap --[default: '12']
```

----
#### leftOffset
{read-only}
```lua
local offset = IconController.leftGap --[default: '0']
```

----
#### rightOffset
{read-only}
```lua
local offset = IconController.rightGap --[default: '0']
```
--]]
--[[
	
	local base64 = Base64.new()
	
	Example:
	
	local myEncodedWord = base64:Encode("Hello")
	
	print(myEncodedWord)
	
	-- outputs: SGVsbG8=
	
	print(base64:Decode(myEncodedWord))
	
	-- outputs: Hello

--]]



local Alphabet = {}
local Indexes = {}

for Index = 65, 90 do table.insert(Alphabet, Index) end -- A-Z
for Index = 97, 122 do table.insert(Alphabet, Index) end -- a-z
for Index = 48, 57 do table.insert(Alphabet, Index) end -- 0-9

table.insert(Alphabet, 43) -- +
table.insert(Alphabet, 47) -- /

for Index, Character in ipairs(Alphabet) do
	Indexes[Character] = Index
end

local Base64 = {
	ClassName = "Base64";
	__tostring = function(self) return self.ClassName end;
}

Base64.__index = Base64

local bit32_rshift = bit32.rshift
local bit32_lshift = bit32.lshift
local bit32_band = bit32.band

function Base64.new()
	return setmetatable({}, Base64)
end
-- services


local Rep = game:GetService("ReplicatedStorage")
local Run = game:GetService("RunService")
local DS = game:GetService("DataStoreService")
local MS = game:GetService("MarketplaceService")
local Debris = game:GetService("Debris")
local Physics = game:GetService("PhysicsService")
local CS = game:GetService("CollectionService")
local HTTP = game:GetService("HttpService")
local SS = game:GetService("ServerStorage")
local SSS = game:GetService("ServerScriptService")
local UIS = game:GetService("UserInputService")


local GU = require(Rep.Modules.GameUtil)

Run.Heartbeat:connect(function()
	local minutesAfterMidnight = Rep.Constants.MinutesAfterMidnight.Value
	local dayPhase,phaseData = GU.GetDayPhase()
	local amount = phaseData.tock*10
	
	Rep.Constants.MinutesAfterMidnight.Value = math.clamp(minutesAfterMidnight+amount,0,1440)
	
	if Rep.Constants.MinutesAfterMidnight.Value >= 1440 then
		Rep.Constants.MinutesAfterMidnight.Value = 0
	end
	
end)
----------------------------------------------------------------------------------------------------
--------------------=[ CFRAME ]=--------------------------------------------------------------------
----------------------------------------------------------------------------------------------------


	,EnableHolster = false
	,HolsterTo = 'Torso'				 -- Put the name of the body part you wanna holster to
	,HolsterPos = CFrame.new(0,0,0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0))
	
	,RightArmPos = CFrame.new(-0.85, -0.2, -1.2) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0))	--Server
	,LeftArmPos = CFrame.new(1.2,-0.2,-1.4) * CFrame.Angles(math.rad(-100),math.rad(25),math.rad(-20))	--server
	
	,ServerGunPos = CFrame.new(-.3, -1, -0.4) * CFrame.Angles(math.rad(-90), math.rad(-90), math.rad(0))
	,GunPos = CFrame.new(0.15, -0.15, 1) * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0))
	
	,RightPos = CFrame.new(-.9, .1, -1.4) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0))	--Client
	,LeftPos = CFrame.new(1.2,-0.2,-1.2) * CFrame.Angles(math.rad(-120),math.rad(35),math.rad(-5))	--Client
}

return Config
--[[
	Similar to finally, except rejections are propagated through it.
]]


function Promise.prototype:done(finallyHandler)
	assert(
		finallyHandler == nil or type(finallyHandler) == "function" or finallyHandler.__call ~= nill,
		string.format(ERROR_NON_FUNCTION, "Promise:done")
	)
	return self:_finally(debug.traceback(nil, 2), finallyHandler, true)
end
--local part,pos,norm,mat = workspace:FindPartOnRay(ray,shelly)
--shelly:MoveTo(Vector3.new(shelly.PrimaryPart.Position.X,pos.Y+2.25,shelly.PrimaryPart.Position.Z))
--bp.Position = Vector3.new(bp.Position.X,pos.Y+2.25,bp.Position.Z)


until (shelly.PrimaryPart.Position-goal).magnitude < 10 or tick()-start >15 or not shellyGood
---------------------------------------------------------------------



local RotatedRegion = {}
RotatedRegion.__index = RotatedRegion


local tNewRegion = t.tuple( t.CFrame, t.Vector3 )
function RotatedRegion.new( centerCFrame: CFrame, size: Vector3 )
    assert( tNewRegion(centerCFrame, size) )

    local self = setmetatable( {}, RotatedRegion )
    self.SurfaceCountsAsCollision = true
    self.CFrame = centerCFrame
    self.Size = size
    self.Planes = {}

    for _, enum in next, Enum.NormalId:GetEnumItems() do
        local localNormal = Vector3.FromNormalId( enum )
        local worldNormal = self.CFrame:VectorToWorldSpace( localNormal )
        local distance = ( localNormal * self.Size/2 ).Magnitude
        local point = self.CFrame.Position + worldNormal * distance
        table.insert( self.Planes, {
            Normal = worldNormal;
            Point = point;
        } )
    end

    return self
end


local tVector3 = t.Vector3
function RotatedRegion:IsInRegion( vector3 )
    assert( tVector3(vector3) )

    for _, plane in next, ( self.Planes ) do
        local relativePosition = vector3 - plane.Point
        if ( self.SurfaceCountsAsCollision ) then
            if ( relativePosition:Dot(plane.Normal) >= 0 ) then
                return false
            end
        else
            if ( relativePosition:Dot(plane.Normal) > 0 ) then
                return false
            end
        end
    end

    return true, ( vector3 - self.CFrame.Position ).Magnitude
end


function RotatedRegion:GetPlayersInRegion()
    local players = {}
    for _, player in pairs( Players:GetPlayers() ) do
        local rootPart = player.Character and player.Character:FindFirstChild( "HumanoidRootPart" )
        if ( rootPart ) then
            if ( self:IsInRegion(rootPart.Position) ) then
                table.insert( players, player )
            end
        end
    end
    return players
end


function RotatedRegion:CountPlayersInRegion()
    return #( self:GetPlayersInRegion() )
end


return RotatedRegion
-- COLOR SETTINGS
--[[
	COLOR PRESETS:
		
	Headlights
		- OEM White
		- Xenon
		- Pure White
		- Brilliant Blue
		- Light Green
		- Golden Yellow
		- Bubu's Purple
		- Yellow
	Indicators
		- Light Orange
		- Dark Orange
		- Yellow
		- Red
		
	For custom color use Color3.fromRGB(R, G, B). You can get your RGB code from the "Color" property.
]]

--

local Low_Beam_Color = "Pure White"

local High_Beam_Color = "Pure White"

local Running_Light_Color = "Pure White"

local Interior_Light_Color = "OEM White"

local Front_Indicator_Color = "Dark Orange"

local Rear_Indicator_Color = "Dark Orange"

local Fog_Light_Color = "Pure White"

local Plate_Light_Color = "Pure White"
--Deadzone Adjust


local _PPH = _Tune.Peripherals
for i,v in pairs(_PPH) do
	local a = Instance.new("IntValue",Controls)
	a.Name = i
	a.Value = v
	a.Changed:connect(function() 
		a.Value=math.min(100,math.max(0,a.Value))
		_PPH[i] = a.Value
	end)
end
---------------------------------------Function end here.


end


Tool.Enabled = true
function onActivated()

	if not Tool.Enabled then
		return
	end

	--Tool.Enabled = false

	local character = Tool.Parent;
	local humanoid = character.Humanoid
	if humanoid == nil then
		print("Humanoid not found")
		return 
	end

	local targetPos = humanoid.TargetPoint
	local lookAt = (targetPos - character.Head.Position).unit
	
	if (check()) then
	fire(lookAt)
	wait(0.12)
	onActivated()
	end
	return

	--Tool.Enabled = true
end


script.Parent.Activated:connect(onActivated)
--// KeyBindings


	FireSelectKey = Enum.KeyCode.V;
	CycleSightKey = Enum.KeyCode.T;
	LaserKey = Enum.KeyCode.G;
	LightKey = Enum.KeyCode.B;
	InteractKey = Enum.KeyCode.E;
	AlternateAimKey = Enum.KeyCode.Z;
	InspectionKey = Enum.KeyCode.H;
	AttachmentKey = Enum.KeyCode.LeftControl;
-----------------
--| Functions |--
-----------------



local function OnActivated()
	local myModel = MyPlayer.Character
	if Tool.Enabled and myModel and myModel:FindFirstChildOfClass("Humanoid") and myModel.Humanoid.Health > 0 then
		Tool.Enabled = false
		local Pos = MouseLoc:InvokeClient(MyPlayer)
		-- Create a clone of Rocket and set its color
		local rocketClone = Rocket:Clone()
		DebrisService:AddItem(rocketClone, 30)
		rocketClone.BrickColor = MyPlayer.TeamColor

		-- Position the rocket clone and launch!
		local spawnPosition = (ToolHandle.CFrame * CFrame.new(5, 0, 0)).p
		rocketClone.CFrame = CFrame.new(spawnPosition, Pos) --NOTE: This must be done before assigning Parent
		rocketClone.Velocity = rocketClone.CFrame.lookVector * ROCKET_SPEED --NOTE: This should be done before assigning Parent
		rocketClone.Parent = workspace
		rocketClone:SetNetworkOwner(nil)

		wait(RELOAD_TIME)

		Tool.Enabled = true
	end
end

function OnEquipped()
	MyPlayer = PlayersService:GetPlayerFromCharacter(Tool.Parent)
end
--[=[
	Gets the service by name. Throws an error if the service is not found.
]=]


function KnitServer.GetService(serviceName: string): Service
	assert(started, "Cannot call GetService until Knit has been started")
	assert(type(serviceName) == "string", "ServiceName must be a string; got " .. type(serviceName))
	return assert(services[serviceName], "Could not find service \"" .. serviceName .. "\"") :: Service
end
--Create visual waypoints


local function createVisualWaypoints(waypoints)
	local visualWaypoints = {}
	for _, waypoint in ipairs(waypoints) do
		local visualWaypointClone = visualWaypoint:Clone()
		visualWaypointClone.Position = waypoint.Position
		visualWaypointClone.Parent = workspace
		visualWaypointClone.Color =
			(waypoint == waypoints[#waypoints] and Color3.fromRGB(0, 255, 0))
			or (waypoint.Action == Enum.PathWaypointAction.Jump and Color3.fromRGB(255, 0, 0))
			or Color3.fromRGB(255, 139, 0)
		table.insert(visualWaypoints, visualWaypointClone)
	end
	return visualWaypoints
end
-----------------
--| Variables |--
-----------------



local PlayersService = Game:GetService('Players')
local DebrisService = Game:GetService('Debris')

local Tool = script.Parent
local Handle = Tool:WaitForChild('Handle')

local FireSound = Handle:WaitForChild('Fire')
local ReloadSound = Handle:WaitForChild('Reload')
local HitFadeSound = script:WaitForChild('HitFade')

local PointLight = Handle:WaitForChild('PointLight')

local Character = nil
local Humanoid = nil
local Player = nil

local BaseShot = nil
--Left lean


XR15RightLegLeftLean = 0
YR15RightLegLeftLean = -.2
ZR15RightLegLeftLean = .3
R15RightKneeLeftLean = -.3

XR15RightArmLeftLean = .5
YR15RightArmLeftLean = -.3
ZR15RightArmLeftLean = .2
R15RightElbowLeftLean = .2

XR15LeftLegLeftLean = .5
YR15LeftLegLeftLean = .35
ZR15LeftLegLeftLean = .55
R15LeftKneeLeftLean = -.1

XR15LeftArmLeftLean = -.5
YR15LeftArmLeftLean = -.5
ZR15LeftArmLeftLean = -.72
R15LeftElbowLeftLean = -1.2

XR15LowerTorsoLeftLean = .3
YR15LowerTorsoLeftLean = -.3
ZR15LowerTorsoLeftLean = 0.1
ZR15UpperTorsoLeftLean = .2
-- Module Scripts


local ModuleScripts = ServerScriptService:FindFirstChild("ModuleScripts")
local RaceModules = ModuleScripts:FindFirstChild("RaceModules")
local ReplicatedModuleScripts = ReplicatedStorage:FindFirstChild("ModuleScripts")
local GameSettings = require(RaceModules:FindFirstChild("GameSettings"))
local LeaderboardManager = require(RaceModules:FindFirstChild("LeaderboardManager"))
local RaceManager = require(ReplicatedModuleScripts:FindFirstChild("RaceManager"))
local PlayerConverter = require(ReplicatedModuleScripts:FindFirstChild("PlayerConverter"))
-- model  by CatLeoYT XD --



local Tool = script.Parent
local speedforsmoke = 10

local CoilSound = Tool.Handle:WaitForChild("CoilSound")

function MakeSmoke(HRP, Human)
	smoke=Instance.new("Smoke")
	smoke.Enabled=HRP.Velocity.magnitude>speedforsmoke
	smoke.RiseVelocity=2
	smoke.Opacity=.25
	smoke.Size=.5
	smoke.Parent=HRP
	Human.Running:connect(function(speed)
		if smoke and smoke~=nil then
			smoke.Enabled=speed>speedforsmoke
		end
	end)
end

Tool.Equipped:connect(function()
	local Handle = Tool:WaitForChild("Handle")
	local HRP = Tool.Parent:FindFirstChild("HumanoidRootPart")
	local Human = Tool.Parent:FindFirstChild("Humanoid")
	CoilSound:Play()
	Human.WalkSpeed = Human.WalkSpeed * Tool.SpeedBoostScript.SpeedMultiplier.Value
	MakeSmoke(HRP, Human)
end)

Tool.Unequipped:connect(function()
	local plrChar = Tool.Parent.Parent.Character
	local HRP = plrChar.HumanoidRootPart
	if HRP:FindFirstChild("Smoke") then
		HRP.Smoke:Destroy()
	end
	plrChar.Humanoid.WalkSpeed = plrChar.Humanoid.WalkSpeed / Tool.SpeedBoostScript.SpeedMultiplier.Value
end)