Pinkstack/roblox-luau-corpus-text huggingface dataset:
--[[Engine]]


	--Torque Curve
	Tune.Horsepower		= 641		--	[TORQUE CURVE VISUAL]
	Tune.IdleRPM		= 700		--		https://www.desmos.com/calculator/2uo3hqwdhf
	Tune.PeakRPM		= 6000		--		Use sliders to manipulate values
	Tune.Redline		= 6700		--		Copy and paste slider values into the respective tune values
	Tune.EqPoint		= 5500
	Tune.PeakSharpness	= 7.5
	Tune.CurveMult		= 0.16
	
	--Incline Compensation
	Tune.InclineComp	= 1.7			-- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
	
	--Misc
	Tune.RevAccel		= 150		-- 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		= 500		-- Clutch engagement threshold (higher = faster response)
--/////////////////////////////////////////////////////////--



local dZIndex 	 = 2
local dScrollBar = 4
local dBackground 	= Color3.new(31/255, 31/255, 31/255)
local dSecondaryBackground = dBackground:lerp(Color3.new(1,1,1), 0.1);
local dTransparency = 0
local dPixelSize 	= 0
local dBorder 		= Color3.new(27/255,42/255,53/255)
local dPosition 	= UDim2.new(0,5,0,5)
local dCanvasSize 	= UDim2.new(0, 0, 0, 0)
local dScrollImage 	= "http://roblox.com/asset?id=158348114"
local dTextColor = Color3.new(1,1,1)
local dSize 	 = UDim2.new(1,-10,1,-10)
local dFont 	 = "SourceSans"
local dTextSize  = 16
local dPlaceholderColor = Color3.fromRGB(178, 178, 178)
local MouseIcons = {
	Horizontal = "rbxassetid://1243146213";
	Vertical = "rbxassetid://1243145985";
	LeftCorner = "rbxassetid://1243145459";
	RightCorner = "rbxassetid://1243145350";
	TopRight = "rbxassetid://1243145459";
	TopLeft = "rbxassetid://1243145350";
}
--Tune


OverheatSpeed = .5 --How fast the car will overheat
CoolingEfficiency = .2 --How fast the car will cool down
RunningTemp = 60 --In degrees

Fan = false --Cooling fan
FanTemp = 110 --At what temperature the cooling fan will activate
FanTempAlpha = 130 --At what temperature the cooling fan will deactivate
FanSpeed = .08 --How fast the car will cool down
FanVolume = .5 --Sound volume

BlowupTemp = 130 --At what temperature the engine will blow up

GUI = true --GUI temperature gauge
--	if Input.KeyCode == Enum.KeyCode.Z then
--		if Holding.Value == "Z" then
--			isHolding = false
--			SkillsHandler:FireServer("Skill", "Release", "Z", Mouse:GetHit().Position, Char.HumanoidRootPart.CFrame)
--			Animations.Z:AdjustSpeed(1)
--		end
--	end
--end)
--[[
	Server init file
]]


local ServerStorage = game:GetService("ServerStorage")
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local PlayerManager = require(ServerStorage.Source.Managers.PlayerManager)
local ServerStateMachine = require(ServerStorage.Source.GameStates.ServerStateMachine)
local Constants = require(ReplicatedStorage.Source.Common.Constants)
local Logger = require(ReplicatedStorage.Dependencies.GameUtils.Logger)
local ProfessorController = require(ServerStorage.Source.Controllers.ProfessorController)
local SetupLobby = require(ServerStorage.Source.SetupLobby)

Logger.setCutoff(Constants.LoggerLevel.Warn)

PlayerManager.init()
ServerStateMachine.init()
ProfessorController.init()

SetupLobby()
--//# Terrain Setup


function SetupTerrain()
	local Terrain = game.Workspace.Terrain;
	Terrain.WaterTransparency = 1
	Terrain.WaterReflectance = 1
end

if Enabled then
	if TerrainPlusEnabled then
		SetupTerrain()
		warn("Loaded Better Terrain")
	end
	if BetterLightingEnabled then
		SetupLighting_()
		warn("Loaded Lighting+")
	end
elseif not Enabled then
	error("Script Disabled.")
	return false
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.05,1,-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(0), 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(-.65, -0.2, -1) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0))	--Client
	,LeftPos = CFrame.new(1.2,0.15,-1.6) * CFrame.Angles(math.rad(-120),math.rad(35),math.rad(-20))	--Client
}

return Config
-- register what control scripts we are using


do
	local PlayerScripts = LocalPlayer:WaitForChild("PlayerScripts")
	local canRegisterControls = pcall(function() PlayerScripts:RegisterTouchMovementMode(Enum.TouchMovementMode.Default) end)

	if canRegisterControls then
		PlayerScripts:RegisterTouchMovementMode(Enum.TouchMovementMode.Thumbstick)
		PlayerScripts:RegisterTouchMovementMode(Enum.TouchMovementMode.DPad)
		PlayerScripts:RegisterTouchMovementMode(Enum.TouchMovementMode.Thumbpad)
		PlayerScripts:RegisterTouchMovementMode(Enum.TouchMovementMode.ClickToMove)
		PlayerScripts:RegisterTouchMovementMode(Enum.TouchMovementMode.DynamicThumbstick)

		PlayerScripts:RegisterComputerMovementMode(Enum.ComputerMovementMode.Default)
		PlayerScripts:RegisterComputerMovementMode(Enum.ComputerMovementMode.KeyboardMouse)
		PlayerScripts:RegisterComputerMovementMode(Enum.ComputerMovementMode.ClickToMove)
	end
end

local DynamicThumbstickAvailable = pcall(function() 
	return Enum.DevTouchMovementMode.DynamicThumbstick and Enum.TouchMovementMode.DynamicThumbstick
end)

local ControlState = {}
ControlState.Current = nil
function ControlState:SwitchTo(newControl)
	if ControlState.Current == newControl then return end
	
	if ControlState.Current then
		ControlState.Current:Disable()
	end
	
	ControlState.Current = newControl
	
	if ControlState.Current then
		ControlState.Current:Enable()
	end
end

function ControlState:IsTouchJumpModuleUsed()
	return isJumpEnabled
end
------------------------------------------------------------------------	


	for i=1,math.random(100,10000) do
	wait()
	local bewl = script.Parent:FindFirstChild("Bool")
	if bewl then
	local ignoreList = {}
	local ray = Ray.new(script.Parent.Part8.Position, missile.CFrame.lookVector * 999)
	local hit game.Workspace:FindPartOnRayWithIgnoreList(ray, ignoreList, false)
	local pos = script.Parent.Bool.Position
	local line = Instance.new("Part")
		line.Name = "Line"
		line.FormFactor = "Symmetric"
		line.Size = Vector3.new(1, 1, 1)
		line.BrickColor = BrickColor.new("White")
		line.Transparency = 0
		line.CanCollide = false
		line.Anchored = true
		line.Locked = true
		line.TopSurface, line.BottomSurface = 0, 0
		line.CFrame = CFrame.new(script.Parent.Part8.Position:lerp(pos, 0.5), pos)
		local mesh = Instance.new("BlockMesh", line)
		mesh.Scale = Vector3.new(0.03, 0.03, (script.Parent.Part8.Position - pos).magnitude)
		game.Debris:AddItem(line,0.08)
		line.Parent = script.Parent
		wait(0.001)

	else 
	print("No bool")
	break 
	end
	end
--Fade tween


local fadeInfo = TweenInfo.new(Fade, Enum.EasingStyle.Sine, Enum.EasingDirection.In)
local strechInfo = TweenInfo.new(Fade / 1.05, Enum.EasingStyle.Quint, Enum.EasingDirection.In)
local fadeGoal = {Transparency = 1}

local accumulatedChance = 0
--[[Engine]]


	--Torque Curve
	Tune.Horsepower		= 900		--	[TORQUE CURVE VISUAL]
	Tune.IdleRPM		= 700		--		https://www.desmos.com/calculator/2uo3hqwdhf
	Tune.PeakRPM		= 2000		--		Use sliders to manipulate values
	Tune.Redline		= 10000		--		Copy and paste slider values into the respective tune values
	Tune.EqPoint		= 5500
	Tune.PeakSharpness	= 7.5
	Tune.CurveMult		= 0.16
	
	--Incline Compensation
	Tune.InclineComp	= 1.7			-- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
	
	--Misc
	Tune.RevAccel		= 150		-- 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		= 500		-- Clutch engagement threshold (higher = faster response)
--The "tele1" brick takes you to "tele2".



debounce = false

function onTouched(hit)
	if debounce then return else debounce = true end
	if hit.Parent:FindFirstChild("Humanoid") then
		local player = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)
		if player then
			
			local gui = Instance.new("ScreenGui", player.PlayerGui)
			local label = Instance.new("TextLabel", gui)
			label.Size = UDim2.new(2, 0, 2, 0)
			label.Position = UDim2.new(-0.5, 0, -0.5, 0)
			label.BackgroundColor3 = Color3.new(0,0,0)
			label.BackgroundTransparency = 1
			label.Text = ""
			while gui and label and label.BackgroundTransparency > 0 do
				wait()
				label.BackgroundTransparency = label.BackgroundTransparency - 0.1
			end
			if hit then
				hit.Parent:MoveTo(script.Parent.tele2.Position)
			end
wait (0)
			while gui and label and label.BackgroundTransparency < 1 do
				wait()
				label.BackgroundTransparency = label.BackgroundTransparency + 0.1
			end
			if gui then
				gui:Remove()
			end

				end
			end
	debounce = false
end

script.Parent.tele1.Touched:connect(onTouched)
--[[
-- превращаем блоки в ландшафт
game.Workspace.Terrain:FillBlock(game.Workspace.Part1.CFrame, game.Workspace.Part1.Size, Enum.Material.Metal)
game.Workspace.Terrain:FillBlock(game.Workspace.Part2.CFrame, game.Workspace.Part2.Size, Enum.Material.Water)
game.Workspace.Terrain:FillBlock(game.Workspace.Part3.CFrame, game.Workspace.Part3.Size, Enum.Material.Grass)

-- убираем блоки
game.Workspace.Part1.Parent=nil
game.Workspace.Part2.Parent=nil
game.Workspace.Part3.Parent=nil


-- производим замену ландшафта
local region = Region3.new(Vector3.new(-20,-20,-80), Vector3.new(20,10,-60))
region = region:ExpandToGrid(4)
-- чтение
local material, occupancy = game.Workspace.Terrain:ReadVoxels(region, 4)
local size = material.Size
for x = 1, size.X do
	for y = 1, size.Y do
		for z = 1, size.Z do
			print("Material at (", x, y, z, "): ", material[x][y][z])
			material[x][y][z] = Enum.Material.Water
			print("Occupancy at (", x, y, z, "): ", occupancy[x][y][z])
		end
	end
end
-- запись
game.Workspace.Terrain:WriteVoxels(region, 4, material, occupancy)
]]

--
-- DRIVE LOOP
----------------------------------------


while true do

	-- Input values taken from the VehicleSeat
	local steerFloat = vehicleSeat.SteerFloat  -- Forward and backward direction, between -1 and 1
	local throttle = vehicleSeat.ThrottleFloat  -- Left and right direction, between -1 and 1

	-- Convert "steerFloat" to an angle for the HingeConstraint servos
	local turnAngle = steerFloat * MAX_TURN_ANGLE
	wheelHingeR.TargetAngle = turnAngle
	wheelHingeL.TargetAngle = turnAngle

	-- Apply torque to the CylindricalConstraint motors depending on our throttle input and the current speed of the car
	local currentVel = getAverageVelocity()
	local targetVel = 0
	local motorTorque = 0

	-- Idling
	if math.abs(throttle) < 0.1 then
		motorTorque = 100

	-- Accelerating
	elseif math.abs(throttle * currentVel) > 0 then
		-- Reduce torque with speed (if torque was constant, there would be a jerk reaching the target velocity)
		-- This also produces a reduction in speed when turning
		local r = math.abs(currentVel) / MAX_SPEED
		-- Torque should be more sensitive to input at low throttle than high, so square the "throttle" value
		motorTorque = math.exp( - 3 * r * r ) * TORQUE * throttle * throttle
		targetVel = math.sign(throttle) * 10000  -- Arbitrary large number

	-- Braking
	else
		motorTorque = BRAKING_TORQUE * throttle * throttle
	end

	-- Use helper functions to apply torque and target velocity to all motors
	setMotorTorque(motorTorque)
	setMotorVelocity(targetVel)
	wait()
end
--[[ This HelpButton Theme displays by default the headshot of the LocalPlayer.
   Modes: {
          "HEADSHOT" -- LocalPlayer Headshot Thumb
          "CUSTOM" -- Loads from Settings
          }
--]]


return function(data)
	local playergui = service.PlayerGui
	local localplayer = service.Players.LocalPlayer
	local gui = service.New("ScreenGui")

	local toggle = service.New("ImageButton", gui)
	local toggle1 = service.New("Frame", gui)

	local round = Instance.new("UICorner")
	round.CornerRadius = UDim.new(0.2, 0)
	round.Parent = toggle1

	local round1 = Instance.new("UICorner")
	round1.CornerRadius = UDim.new(0.2, 0)
	round1.Parent = toggle

	local gTable = client.UI.Register(gui)

	if client.UI.Get("HelpButton", gui, true) then
		gui:Destroy()
		gTable:Destroy()
		return nil
	end

	gTable.Name = "HelpButton"
	gTable.CanKeepAlive = false

	toggle.Name = "Toggle"
	toggle1.Name = "RoundFrame"
	toggle1.BackgroundColor3 = Color3.fromRGB(17, 17, 17)
	toggle.BackgroundTransparency = 1
	toggle1.Position = UDim2.new(1, -45, 1, -45)
	toggle.Position = UDim2.new(1, -42, 1, -38)
	toggle.Size = UDim2.new(0, 33, 0, 33) --33
	toggle.ZIndex = 67
	toggle1.Size = UDim2.new(0, 40, 0, 40)
		toggle.Image =
			"https://www.roblox.com/headshot-thumbnail/image?userId=" ..
			localplayer.UserId .. "&width=420&height=420&format=png"



	toggle.ImageTransparency = 0

	--if client.UI.Get("Chat") then
	--	toggle.Position = UDim2.new(1, -(45+40),1, -45)
	--end

	toggle.MouseButton1Down:Connect(
		function()
			local found = client.UI.Get("UserPanel", nil, true)
			if found then
				found.Object:Destroy()
			else
				client.UI.Make("UserPanel", {})
			end
		end
	)

	gTable:Ready()
end
-- Return empty string if keys is empty.


function printProps(
	keys: Array<string>,
	props: Record<string, unknown>,
	config: Config,
	indentation: string,
	depth: number,
	refs: Refs,
	printer: Printer
): string
	local indentationNext = indentation .. config.indent

	-- ROBLOX deviation: adding default value as we don't support colors
	local colors = config.colors or DEFAULT_COLORS
	return Array.join(
		Array.map(keys, function(key: string)
			local value = props[key]
			local printed = printer(value, config, indentationNext, depth, refs)

			if typeof(value) ~= "string" then
				if string.find(printed, "\n") ~= nil then
					printed = config.spacingOuter .. indentationNext .. printed .. config.spacingOuter .. indentation
				end
				printed = "{" .. printed .. "}"
			end

			-- ROBLOX deviation: keys can be of type table. eg. when using ReactRoblox.Change
			local key_ = if typeof(key) == "table"
				then (if key.name then key.name else printer(key, config, indentationNext, depth, refs))
				else key

			return config.spacingInner
				.. indentation
				.. colors.prop.open
				.. colors.prop.open
				.. key_
				.. colors.prop.close
				.. "="
				.. colors.value.open
				.. printed
				.. colors.value.close
				.. colors.value.close
		end),
		""
	)
end
exports.printProps = printProps
-- ROBLOX deviation: this is a class export upstream, so optional overrides are nil-able, and it's extensible by default


export type React_Component<Props, State = nil> = {
	-- fields
	props: Props,
	state: State,

	-- action methods

	setState: (
		self: React_Component<Props, State>,
		partialState: State | ((State, Props) -> State?),
		callback: (() -> any)?
	) -> (),

	forceUpdate: (callback: ((() -> ())?)) -> (),

	-- lifecycle methods

	init: ((props: Props?, context: any?) -> ())?,
	render: (self: React_Component<Props, State>) -> React_Node,
	componentWillMount: ((self: React_Component<Props, State>) -> any)?,
	UNSAFE_componentWillMount: ((self: React_Component<Props, State>) -> any)?,
	componentDidMount: ((self: React_Component<Props, State>) -> any)?,
	componentWillReceiveProps: ((
		self: React_Component<Props, State>,
		nextProps: Props,
		nextContext: any
	) -> any)?,
	UNSAFE_componentWillReceiveProps: ((
		self: React_Component<Props, State>,
		nextProps: Props,
		nextContext: any
	) -> any)?,
	shouldComponentUpdate: ((
		self: React_Component<Props, State>,
		nextProps: Props,
		nextState: State,
		nextContext: any
	) -> boolean)?,
	componentWillUpdate: ((
		self: React_Component<Props, State>,
		nextProps: Props,
		nextState: State,
		nextContext: any
	) -> any)?,
	UNSAFE_componentWillUpdate: ((
		self: React_Component<Props, State>,
		nextProps: Props,
		nextState: State,
		nextContext: any
	) -> any)?,
	componentDidUpdate: ((
		self: React_Component<Props, State>,
		prevProps: Props,
		prevState: State,
		prevContext: any
	) -> any)?,
	componentWillUnmount: ((self: React_Component<Props, State>) -> any)?,
	componentDidCatch: ((
		self: React_Component<Props, State>,
		error: Error,
		info: {
			componentStack: string,
		}
	) -> any)?,
	getDerivedStateFromProps: ((props: Props, state: State) -> any)?,
	getDerivedStateFromError: ((error: Error) -> any)?,

	-- long tail of other stuff not modeled very well

	-- ROBLOX deviation: this field is only used in relation to string refs, which we do not support
	-- refs: any,
	-- context: any,
	getChildContext: (self: React_Component<Props, State>) -> any,
	-- statics
	__componentName: string,
	displayName: string?,
	childContextTypes: any?,
	contextTypes: any?,
	propTypes: any?,

	-- ROBLOX FIXME: this is a legacy Roact field and should be removed in React 18 Lua
	validateProps: (Props) -> (boolean, string?)?,

	-- We don't add a type for `defaultProps` so that its type may be entirely
	-- inferred when we diff the type for `defaultProps` with `Props`. Otherwise
	-- the user would need to define a type (which would be redundant) to override
	-- the type we provide here in the base class.
	-- ROBLOX deviation: Luau doesn't do the inference above
	defaultProps: Props?,
	-- ROBLOX deviation: class export allows assigning additional custom instance fields
	[string]: any,
}
--mobile--




local Buttons = script.Parent:WaitForChild("Buttons")
local Left = Buttons:WaitForChild("Left")
local Right = Buttons:WaitForChild("Right")
local Brake = Buttons:WaitForChild("Brake")
local Gas = Buttons:WaitForChild("Gas")
local Handbrake = Buttons:WaitForChild("Handbrake")

if UserInputService.TouchEnabled and not UserInputService.MouseEnabled then
	Buttons.Visible = true
end
local function LeftTurn(Touch, GPE)
	if Touch.UserInputState == Enum.UserInputState.Begin then
		_GSteerT = -1
		_SteerL = true
	else
		if _SteerR then
			_GSteerT = 1
		else
			_GSteerT = 0
		end
		_SteerL = false
	end
end
Left.InputBegan:Connect(LeftTurn)
Left.InputEnded:Connect(LeftTurn)
--[[
	Returns a snapshot of this component given the current props and state. Must
	be overridden by consumers of Roact and should be a pure function with
	regards to props and state.

	TODO (#199): Accept props and state as arguments.
]]


function Component:render()
	local internalData = self[InternalData]

	local message = componentMissingRenderMessage:format(tostring(internalData.componentClass))

	error(message, 0)
end
-- Touching this Battle Armor doubles you MaxHealth and heals you to full power



local debounce = false

function getPlayer(humanoid)
	-- find the owning player of a humanoid.
	local players = game.Players:children()
	for i = 1, #players do
		if players[i].Character ~= nil then
			if players[i].Character.Humanoid == humanoid then return players[i] end
		end
	end
	return nil
end


function putOnArmor(humanoid)

	local torso = humanoid.Parent.Torso

	torso.Reflectance = 0
	humanoid.MaxHealth = 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
	
	
	local player = getPlayer(humanoid)
	if player ~= nil then
		local message = Instance.new("Message")
		message.Text = "You are God"
		message.Parent = player
		wait(2)
		message.Text = "Live Free!"
		wait(2)
		message.Parent = nil
	end


end

function hasArmor(humanoid)
	return (humanoid.MaxHealth > 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999)
end

function onTouched(hit)
	local humanoid = hit.Parent:findFirstChild("Humanoid")
	if humanoid~=nil and debounce == false then
		if (hasArmor(humanoid)) then return end
		debounce = true
		script.Parent.Parent = nil
		putOnArmor(humanoid)
		debounce = false
	end
end


script.Parent.Touched:connect(onTouched)
--// SS3.33T Police Edit originally for 2017 Mercedes-Benz E300 by Itzt and MASERATl, base SS by Inspare


 
wait(0.1)
local player = game.Players.LocalPlayer
local HUB = script.Parent.HUB
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()
--[[
	Converts an event into a Promise with an optional predicate
]]


function Promise.fromEvent(event, predicate)
	predicate = predicate or function()
		return true
	end

	return Promise._new(debug.traceback(nil, 2), function(resolve, reject, onCancel)
		local connection
		local shouldDisconnect = false

		local function disconnect()
			connection:Disconnect()
			connection = nil
		end

		-- We use shouldDisconnect because if the callback given to Connect is called before
		-- Connect returns, connection will still be nil. This happens with events that queue up
		-- events when there's nothing connected, such as RemoteEvents

		connection = event:Connect(function(...)
			local callbackValue = predicate(...)

			if callbackValue == true then
				resolve(...)

				if connection then
					disconnect()
				else
					shouldDisconnect = true
				end
			elseif type(callbackValue) ~= "boolean" then
				error("Promise.fromEvent predicate should always return a boolean")
			end
		end)

		if shouldDisconnect and connection then
			return disconnect()
		end

		onCancel(function()
			disconnect()
		end)
	end)
end

return Promise
--// # key, Priority


mouse.KeyDown:connect(function(key)
	if key=="g" then 
		if veh.Lightbar.middle.Priority.IsPlaying == true then
		veh.Lightbar.middle.Wail:Stop()
		veh.Lightbar.middle.Yelp:Stop()
		veh.Lightbar.middle.Priority:Stop()
		script.Parent.Parent.Sirens.Priority.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
		veh.Lightbar.WAIL.Transparency = 1
		veh.Lightbar.YELP.Transparency = 1
		veh.Lightbar.PIER.Transparency = 1
		veh.Lightbar.STBY.Transparency = 0
		else
		veh.Lightbar.middle.Wail:Stop()
		veh.Lightbar.middle.Yelp:Stop()
		veh.Lightbar.middle.Priority:Play()
		script.Parent.Parent.Sirens.Priority.BackgroundColor3 = Color3.fromRGB(215, 135, 110)
		script.Parent.Parent.Sirens.Wail.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
		script.Parent.Parent.Sirens.Yelp.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
		veh.Lightbar.WAIL.Transparency = 1
		veh.Lightbar.YELP.Transparency = 1
		veh.Lightbar.PIER.Transparency = 0
		veh.Lightbar.STBY.Transparency = 1
		end
	end
end)
-- functions



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

function onDied()
	pose = "Dead"
end

function onJumping()
	pose = "Jumping"
end

function onClimbing()
	pose = "Climbing"
end

function onGettingUp()
	pose = "GettingUp"
end

function onFreeFall()
	pose = "FreeFall"
end

function onFallingDown()
	pose = "FallingDown"
end

function onSeated()
	pose = "Seated"
end

function onPlatformStanding()
	pose = "PlatformStanding"
end

function moveJump()
	RightShoulder.MaxVelocity = 0.5
	LeftShoulder.MaxVelocity = 0.5
	RightShoulder.DesiredAngle = 3.14
	LeftShoulder.DesiredAngle = -3.14
	RightHip.DesiredAngle = 0
	LeftHip.DesiredAngle = 0
end