Roblox/luau_corpus huggingface dataset:
--| Service |--
local Players = game:GetService("Players")
local Replicated = game:GetService("ReplicatedStorage")
local Debris = game:GetService("Debris")
--[=[
	@function Multiply
	@within Blend

	@param background Color3 -- The background colour.
	@param foreground Color3 -- The foreground colour.
	@return Color3 -- The resulting colour.
]=]
return PrepFilter("Multiply", function(background: number, foreground: number): number
	return ((foreground * 255) * (background * 255)) / 255
end)
----------------------------------------------------------------------------------------------------
-----------------=[ RECOIL & PRECISAO ]=------------------------------------------------------------
----------------------------------------------------------------------------------------------------
	,VRecoil = {8,12}				--- Vertical Recoil
	,HRecoil = {8,12}				--- Horizontal Recoil
	,AimRecover = .7				---- Between 0 & 1
	
	,RecoilPunch = .15
	,VPunchBase = 2.5				--- Vertical Punch
	,HPunchBase = 1.7				--- Horizontal Punch
	,DPunchBase = 1 				--- Tilt Punch | useless
	
	,AimRecoilReduction = 5 		--- Recoil Reduction Factor While Aiming (Do not set to 0)
	,PunchRecover = 0.2
	,MinRecoilPower = .5
	,MaxRecoilPower = 3.5
	,RecoilPowerStepAmount = .25
	
	,MinSpread = 0.56				--- Min bullet spread value | Studs
	,MaxSpread = 35					--- Max bullet spread value | Studs
	,AimInaccuracyStepAmount = 0.5
	,WalkMultiplier = 0				--- Bullet spread based on player speed

	,SwayBase = 0.25				--- Weapon Base Sway | Studs
	,MaxSway =	1.5					--- Max sway value based on player stamina | Studs
--[[
	Start
]]

if PATROL_ENABLED then
	coroutine.wrap(function()
		patrol()
	end)()
end

coroutine.wrap(function()
	while isAlive() do
		if target and not attacking and isInstaceAttackable(target) then
			attack()
		end

		wait(1)
	end
end)()
--!strict
local events = require(script.Parent.events)
local constants = require(script.Parent.constants)

local useVerboseLogging = false

local function log(messageType: string, message: string)
	if useVerboseLogging then
		print(("[%s] %s"):format(messageType, message))
	end
end
-- TextLabel default properties
defaults.Font = "SourceSans"
defaults.TextColor3 = "White"
defaults.TextStrokeColor3 = "Black"
defaults.TextTransparency = 0
defaults.TextStrokeTransparency = 1
defaults.BackgroundTransparency = 1
defaults.BorderSizePixel = 0
--//INSPARE//--
local player = game.Players.LocalPlayer
local lightOn = false
-- declarations
local Figure = script.Parent
local Head = Figure:WaitForChild("Head")
local Humanoid = Figure:WaitForChild("Humanoid")
local regening = false
char = game.Players[Figure.Name].Character
--[[
	Fired when state is left
]]
function Transitions.onLeavePreGame(stateMachine, event, from, to, playerComponent)
	PlayerPreGame.leave(stateMachine, playerComponent)
end
--[[
	Fired when PostGame is entered, transitioning the server state
]]
function Transitions.onEnterPostGame(stateMachine, event, from, to)
	Logger.trace("Server state change: ", from, " -> ", to)
	ServerPostGame.enter(stateMachine)
end
--// Damage Settings	
	BaseDamage = 34; -- Torso Damage
	LimbDamage = 25; -- Arms and Legs
	ArmorDamage = 25; -- How much damage is dealt against armor (Name the armor "Armor")
	HeadDamage = 47; -- If you set this to 100, there's a chance the player won't die because of the heal script
-- Takes an instance and overlays it on top of a parent. This is used for
-- overlaying a DevModule's DataModel-based layout on top of existing services.
local function overlay(instance: Instance, parent: Instance)
	for _, child in ipairs(instance:GetChildren()) do
		local existingChild = parent:FindFirstChild(child.Name)

		if existingChild and child.ClassName == "Folder" then
			overlay(child, existingChild)
		else
			move(child, parent)
		end
	end
end
-- 100 == 1  0 == 0  1/0.5

function JamCalculation()
	local L_182_
	if (math.random(1, 100) <= L_24_.JamChance) then	
		L_182_ = true
		L_75_ = true
	else
		L_182_ = false
	end
	return L_182_
end

function TracerCalculation()
	local L_183_
	if (math.random(1, 100) <= L_24_.TracerChance) then	
		L_183_ = true
	else
		L_183_ = false
	end
	return L_183_
end

function ScreamCalculation()
	local L_184_
	if (math.random(1, 100) <= L_24_.SuppressCalloutChance) then	
		L_184_ = true
	else
		L_184_ = false
	end
	return L_184_
end

function SearchResupply(L_185_arg1)
	local L_186_ = false
	local L_187_ = nil
	
	if L_185_arg1:FindFirstChild('ResupplyVal') or L_185_arg1.Parent:FindFirstChild('ResupplyVal') then
		L_186_ = true
		if L_185_arg1:FindFirstChild('ResupplyVal') then
			L_187_ = L_185_arg1.ResupplyVal
		elseif L_185_arg1.Parent:FindFirstChild('ResupplyVal') then
			L_187_ = L_185_arg1.Parent.ResupplyVal
		end
	end
	return L_186_, L_187_
end

function CheckReverb()
	local L_188_, L_189_ = workspace:FindPartOnRayWithIgnoreList(Ray.new(L_6_.CFrame.p, (L_6_.CFrame.upVector).unit * 30), IgnoreList);
		
	if L_188_ then
		local L_190_ = L_59_:WaitForChild('Fire'):FindFirstChild('ReverbSoundEffect') or Instance.new("ReverbSoundEffect", L_59_:WaitForChild('Fire'))
	elseif not L_188_ then
		if L_59_:WaitForChild('Fire'):FindFirstChild('ReverbSoundEffect') then
			L_59_.Fire.ReverbSoundEffect:Destroy()
		end
	end
end

function UpdateAmmo()
	L_29_.Text = L_103_
	L_30_.Text = L_29_.Text
	
	L_31_.Text = '| ' .. math.ceil(L_104_ / L_24_.StoredAmmo)
	L_32_.Text = L_31_.Text
	
	if L_93_ == 0 then
		L_40_.Image = 'rbxassetid://' .. 1868007495
	elseif L_93_ == 1 then
		L_40_.Image = 'rbxassetid://' .. 1868007947
	elseif L_93_ == 2 then
		L_40_.Image = 'rbxassetid://' .. 1868008584
	end
	
	if L_92_ == 1 then
		L_35_.BackgroundTransparency = 0
		L_36_.BackgroundTransparency = 0.7
		L_37_.BackgroundTransparency = 0.7
		L_38_.BackgroundTransparency = 0.7
		L_39_.BackgroundTransparency = 0.7
	elseif L_92_ == 2 then
		L_35_.BackgroundTransparency = 0
		L_36_.BackgroundTransparency = 0
		L_37_.BackgroundTransparency = 0
		L_38_.BackgroundTransparency = 0
		L_39_.BackgroundTransparency = 0
	elseif L_92_ == 3 then
		L_35_.BackgroundTransparency = 0
		L_36_.BackgroundTransparency = 0
		L_37_.BackgroundTransparency = 0
		L_38_.BackgroundTransparency = 0.7
		L_39_.BackgroundTransparency = 0.7
	elseif L_92_ == 4 then
		L_35_.BackgroundTransparency = 0
		L_36_.BackgroundTransparency = 0
		L_37_.BackgroundTransparency = 0
		L_38_.BackgroundTransparency = 0
		L_39_.BackgroundTransparency = 0.7
	elseif L_92_ == 5 then
		L_35_.BackgroundTransparency = 0
		L_36_.BackgroundTransparency = 0.7
		L_37_.BackgroundTransparency = 0
		L_38_.BackgroundTransparency = 0.7
		L_39_.BackgroundTransparency = 0.7
	elseif L_92_ == 6 then
		L_35_.BackgroundTransparency = 0
		L_36_.BackgroundTransparency = 0.7
		L_37_.BackgroundTransparency = 0
		L_38_.BackgroundTransparency = 0
		L_39_.BackgroundTransparency = 0.7
	end
	
end
-- -- -- -- -- -- --
--DIRECTION SCROLL--
-- -- -- -- -- -- --


Elevator:WaitForChild("Direction").Changed:connect(function(val)
    if val == 1 then
		This.Display.ARW1.UP.Transparency = 0
		This.Display.ARW1.MID.Transparency = 0
		This.Display.ARW1.DOWN.Transparency = 1
    elseif val == -1 then
		This.Display.ARW1.UP.Transparency = 1
		This.Display.ARW1.MID.Transparency = 0
		This.Display.ARW1.DOWN.Transparency = 0
	else
		This.Display.ARW1.UP.Transparency = 1
		This.Display.ARW1.MID.Transparency = 1
		This.Display.ARW1.DOWN.Transparency = 1
    end
end)
-- Constants
local DEBUG = false								-- Whether or not to use debugging features of FastCast, such as cast visualization.
local BULLET_SPEED = 100							-- Studs/second - the speed of the bullet
local BULLET_MAXDIST = 1000							-- The furthest distance the bullet can travel 
local BULLET_GRAVITY = Vector3.new(0, -workspace.Gravity, 0)		-- The amount of gravity applied to the bullet in world space (so yes, you can have sideways gravity)
local MIN_BULLET_SPREAD_ANGLE = 1					-- THIS VALUE IS VERY SENSITIVE. Try to keep changes to it small. The least accurate the bullet can be. This angle value is in degrees. A value of 0 means straight forward. Generally you want to keep this at 0 so there's at least some chance of a 100% accurate shot.
local MAX_BULLET_SPREAD_ANGLE = 4					-- THIS VALUE IS VERY SENSITIVE. Try to keep changes to it small. The most accurate the bullet can be. This angle value is in degrees. A value of 0 means straight forward. This cannot be less than the value above. A value of 90 will allow the gun to shoot sideways at most, and a value of 180 will allow the gun to shoot backwards at most. Exceeding 180 will not add any more angular varience.
local FIRE_DELAY = 0								-- The amount of time that must pass after firing the gun before we can fire again.
local BULLETS_PER_SHOT = 1							-- The amount of bullets to fire every shot. Make this greater than 1 for a shotgun effect.
local PIERCE_DEMO = true							-- True if the pierce demo should be used. See the CanRayPierce function for more info.
--// Setting things up
for ind,loc in next,{
	_G = _G;
	game = game;
	spawn = spawn;
	script = script;
	getfenv = getfenv;
	setfenv = setfenv;
	workspace = workspace;
	getmetatable = getmetatable;
	setmetatable = setmetatable;
	loadstring = loadstring;
	coroutine = coroutine;
	rawequal = rawequal;
	typeof = typeof;
	print = print;
	math = math;
	warn = warn;
	error = error;
	pcall = pcall;
	xpcall = xpcall;
	select = select;
	rawset = rawset;
	rawget = rawget;
	ipairs = ipairs;
	pairs = pairs;
	next = next;
	Rect = Rect;
	Axes = Axes;
	os = os;
	tick = tick;
	Faces = Faces;
	delay = delay;
	unpack = unpack;
	string = string;
	Color3 = Color3;
	newproxy = newproxy;
	tostring = tostring;
	tonumber = tonumber;
	Instance = Instance;
	TweenInfo = TweenInfo;
	BrickColor = BrickColor;
	NumberRange = NumberRange;
	ColorSequence = ColorSequence;
	NumberSequence = NumberSequence;
	ColorSequenceKeypoint = ColorSequenceKeypoint;
	NumberSequenceKeypoint = NumberSequenceKeypoint;
	PhysicalProperties = PhysicalProperties;
	Region3int16 = Region3int16;
	Vector3int16 = Vector3int16;
	elapsedTime = elapsedTime;
	require = require;
	table = table;
	type = type;
	wait = wait;
	Enum = Enum;
	UDim = UDim;
	UDim2 = UDim2;
	Vector2 = Vector2;
	Vector3 = Vector3;
	Region3 = Region3;
	CFrame = CFrame;
	Ray = Ray;
	service = service;
} do locals[ind] = loc end
-- DO NOT TOUCH THE CODE BELOW UNLESS YOU KNOW WHAT YOU ARE DOING --












local TweenService = game:GetService("TweenService")

local head = script.Parent.BakariHead
local button = script.Parent.HeadAccessories.Button
local innerHead = script.Parent.HeadAccessories.BakariInnerHead
local innerEars = script.Parent.HeadAccessories.InnerEars
local ears = script.Parent.HeadAccessories.OuterEars
local cap = script.Parent.HeadAccessories.Cap
local lFang = script.Parent.HeadAccessories.LeftFang
local rFang = script.Parent.HeadAccessories.RightFang
local lArm = script.Parent["Left Arm"]
local rArm = script.Parent["Right Arm"]
local t = script.Parent.Torso
local lWing = script.Parent.Extra.LeftWing
local rWing = script.Parent.Extra.RightWing
local lTA = script.Parent.Extra.TornArmL
local rTA = script.Parent.Extra.TornArm
local lLeg = script.Parent["Left Leg"]
local rLeg = script.Parent["Right Leg"]
local bow = script.Parent.Extra.Bow
local bb = script.Parent.Extra.BeltBottom
local fa = script.Parent.Extra.FakeArm



local goal = {}
goal.Transparency = 1

local goal2 = {}
goal2.Transparency = 0
 
local tweenInfo = TweenInfo.new(.2, Enum.EasingStyle.Linear)
-- UAEmaple



function onTouch(part) 
local human = part.Parent:findFirstChild("Humanoid") 
if human ~= nil then 
part.Parent:findFirstChild("Head").Transparency = 1 
part.Parent:findFirstChild("Torso").Transparency = 1 
part.Parent:findFirstChild("Left Arm").Transparency = 1 
part.Parent:findFirstChild("Right Arm").Transparency = 1 
part.Parent:findFirstChild("Left Leg").Transparency = 1 
part.Parent:findFirstChild("Right Leg").Transparency = 1 
if part.Parent:findFirstChild("Head"):findFirstChild("face") == nil then return end 
part.Parent:findFirstChild("Head"):findFirstChild("face"):remove() 
if part.Parent:findFirstChild("Torso"):findFirstChild("roblox") == nil then return end 
part.Parent:findFirstChild("Torso"):findFirstChild("roblox"):remove() 
end 
end 
script.Parent.Touched:connect(onTouch)print("Hello world!")
--// This method is to be used with the new filter API. This method takes the
--// TextFilterResult objects and converts them into the appropriate string
--// messages for each player.
function methods:InternalSendFilteredMessageWithFilterResult(inMessageObj, channelName)
	local messageObj = ShallowCopy(inMessageObj)

	local oldFilterResult = messageObj.FilterResult
	local player = self:GetPlayer()

	local msg = ""
	pcall(function()
		if (messageObj.IsFilterResult) then
			if (player) then
				msg = oldFilterResult:GetChatForUserAsync(player.UserId)
			else
				msg = oldFilterResult:GetNonChatStringForBroadcastAsync()
			end
		else
			msg = oldFilterResult
		end
	end)

	--// Messages of 0 length are the result of two users not being allowed
	--// to chat, or GetChatForUserAsync() failing. In both of these situations,
	--// messages with length of 0 should not be sent.
	if (#msg > 0) then
		messageObj.Message = msg
		messageObj.FilterResult = nil
		self:InternalSendFilteredMessage(messageObj, channelName)
	end
end

function methods:InternalSendSystemMessage(messageObj, channelName)
	local success, err = pcall(function()
		self:LazyFire("eReceivedSystemMessage", messageObj, channelName)
		if self.PlayerObj then
			self.EventFolder.OnNewSystemMessage:FireClient(self.PlayerObj, messageObj, channelName)
		end
	end)
	if not success and err then
		print("Error sending internal system message: " ..err)
	end
end

function methods:UpdateChannelNameColor(channelName, channelNameColor)
	self:LazyFire("eChannelNameColorUpdated", channelName, channelNameColor)
	if self.PlayerObj then
		self.EventFolder.ChannelNameColorUpdated:FireClient(self.PlayerObj, channelName, channelNameColor)
	end
end
--[[
	ROBLOX deviation: skipping JEST_INTERNALS_IGNORE
	original code:
	const JEST_INTERNALS_IGNORE =
	  /^\s+at.*?jest(-.*?)?(\/|\\)(build|node_modules|packages)(\/|\\)/;
]]
local ANONYMOUS_FN_IGNORE = "^%s+at <anonymous>.*$"
---////==========================================\\\---	
--To install the fans, group them together with the switch. You can have multiple fans installed and be controlled by one switch! Just make sure all fans and the switch have the same parent!-- (In other words, if you know how to install SmartLites, then you do the same here)--
---////==========================================\\\---	
Switch = script.Parent.Parent.Parent.Switch.IsOn
Motor = script.Parent.Motor
Shutter = script.Parent.Parent.Housing

function Active()
	if Switch.Value == true then
		Shutter.OpenShutter.Transparency = 0
		Shutter.ClosedShutter.Transparency = 1
		Motor.Sound:Play()
		Motor.Sound.PlaybackSpeed = 0
			while true do
			Motor.BottomParamB = Motor.BottomParamB + 0.01
			Motor.Sound.PlaybackSpeed =  Motor.BottomParamB
			wait()
			if  Motor.BottomParamB >= 1 then break end
			if Switch.Value == false then break end
			
			end
	elseif Switch.Value == false then
			while true do
			script.Parent.Motor.BottomParamB = Motor.BottomParamB - 0.005
			Motor.Sound.PlaybackSpeed =  Motor.BottomParamB
			wait()
			if Switch.Value == true then break end
			if Motor.BottomParamB <= 0 then break end
			end
			Motor.BottomParamB = 0
		Shutter.OpenShutter.Transparency = 1
		Shutter.ClosedShutter.Transparency = 0
	end
	end
Switch.Changed:connect(Active)
--Updates the current selected frame.
local function UpdateActiveButton()
	local ActiveGroup = GetActiveGroup()
	
	--Reset the last frame if it the group has changed.
	if LastActiveGroup ~= ActiveGroup then
		LastActiveGroup = ActiveGroup
		LastFrame = nil
	end
	
	--Return if a controller isn't connected.
	if ControllerConnected() == false then
		return
	end
	
	--Set the frame if a group exiszts.
	if ActiveGroup then
		if not LastFrame then
			LastFrame = ActiveGroup:GetFirstFrame()
		end
		if LastFrame and not LastFrame:IsDescendantOf(game.Players) then
			LastFrame = nil
		end
		
		local CurrentSelectedObject = GuiService.SelectedObject
		if not CurrentSelectedObject or not ActiveGroup:FrameInGroup(CurrentSelectedObject) then
			GuiService.SelectedObject = LastFrame
		else
			LastFrame = CurrentSelectedObject
		end
	else
		GuiService.SelectedObject = nil
	end
end
-- GlobalUpdates object:

local GlobalUpdates = {
	--[[
		_updates_latest = {}, -- [table] {update_index, {{update_id, version_id, update_locked, update_data}, ...}}
		_pending_update_lock = {update_id, ...} / nil, -- [table / nil]
		_pending_update_clear = {update_id, ...} / nil, -- [table / nil]
		
		_new_active_update_listeners = [ScriptSignal] / nil, -- [table / nil]
		_new_locked_update_listeners = [ScriptSignal] / nil, -- [table / nil]
		
		_profile = Profile / nil, -- [Profile / nil]
		
		_update_handler_mode = true / nil, -- [bool / nil]
	--]]
}
GlobalUpdates.__index = GlobalUpdates
--@recursive
local function factorial(n : number) : number
	if n == 0 then return 1 end
	return n * factorial(n - 1)
end

local function binomial(n : number, i : number) : number
	local x : number = nil
	x = (factorial(n)) / 
		(factorial(n - i) * factorial(i))
	return x
end
--(FL.RotVelocity.Magnitude+FR.RotVelocity.Magnitude+RL.RotVelocity.Magnitude+RR.RotVelocity.Magnitude+(speed/1.33034))/5

while wait() do
speed = carSeat.Velocity.Magnitude
power = 0
average = 10*((carSeat.Storage.BrakeBias.Value/100))
track = carSeat.Velocity.Unit*carSeat.CFrame.lookVector
	slipDetection = track.X+track.Z
	
	Right = (carSeat.Parent.Parent.Wheels.RR.Wheel.Velocity.Magnitude+carSeat.Parent.Parent.Wheels.FR.Wheel.Velocity.Magnitude)/2
	Left = (carSeat.Parent.Parent.Wheels.RL.Wheel.Velocity.Magnitude+carSeat.Parent.Parent.Wheels.FL.Wheel.Velocity.Magnitude)/2
	
	if Right > Left then
	left = true
	else
		left = false
	end
	
if script.OVERRIDE.Value == false then
if carSeat.Storage.ASC.Value == true then
	if carSeat.Steer ~= 0 then
		if slipDetection > 0.999 and left == false then
			script.Toggle.Value = true
		else
			script.Toggle.Value = false
		end
	else
		script.Toggle.Value = false
	end
end

if carSeat.Storage.Handbrake.Value == true then
	RRBRAKE.CanCollide = true
	RRBRAKEU.CanCollide = true
	
else
	
	if speed > 0 then
		if script.Parent.Parent.Storage.Brake.Value ~= 0 or script.Toggle.Value == true then
				if RR.RotVelocity.Magnitude + power > average then
					script.Read.Value = true
					RRBRAKE.CanCollide = true
					RRBRAKEU.CanCollide = true --print("RR")

				elseif RR.RotVelocity.Magnitude + power < average then
					 RRBRAKE.CanCollide = false script.Read.Value = false
					 RRBRAKEU.CanCollide = false	
			end
			
		elseif script.Parent.Parent.Storage.Brake.Value == 0 and script.Toggle.Value == false then
			script.Read.Value = false
			RRBRAKE.CanCollide = false
			RRBRAKEU.CanCollide = false
		end
		end
end
else
	RRBRAKE.CanCollide = true
	RRBRAKEU.CanCollide = true
	end
end
--	====================
--	EXPLOSIVE
--	Make a bullet explosive so user can deal a damage to multiple enemy in single shot. NOTE: Explosion won't break joints
--	====================

		ExplosiveEnabled = false;
		Radius = 8;
-- Call this from a function bound to Renderstep with Input Priority
function VehicleController:Update(moveVector, cameraRelative, usingGamepad)
	if self.vehicleSeat then
		if cameraRelative then
			-- This is the default steering mode
			moveVector = moveVector + Vector3.new(self.steer, 0, self.throttle)
			if usingGamepad and onlyTriggersForThrottle and useTriggersForThrottle then
				self.vehicleSeat.ThrottleFloat = -self.throttle
			else
				self.vehicleSeat.ThrottleFloat = -moveVector.Z
			end
			self.vehicleSeat.SteerFloat = moveVector.X

			return moveVector, true
		else
			-- This is the path following mode
			local localMoveVector = self.vehicleSeat.Occupant.RootPart.CFrame:VectorToObjectSpace(moveVector)

			self.vehicleSeat.ThrottleFloat = self:ComputeThrottle(localMoveVector)
			self.vehicleSeat.SteerFloat = self:ComputeSteer(localMoveVector)

			return ZERO_VECTOR3, true
		end
	end
	return moveVector, false
end

function VehicleController:ComputeThrottle(localMoveVector)
	if localMoveVector ~= ZERO_VECTOR3 then
		local throttle = -localMoveVector.Z
		return throttle
	else
		return 0.0
	end
end

function VehicleController:ComputeSteer(localMoveVector)
	if localMoveVector ~= ZERO_VECTOR3 then
		local steerAngle = -math.atan2(-localMoveVector.x, -localMoveVector.z) * (180 / math.pi)
		return steerAngle / self.autoPilot.MaxSteeringAngle
	else
		return 0.0
	end
end

function VehicleController:SetupAutoPilot()
	-- Setup default
	self.autoPilot.MaxSpeed = self.vehicleSeat.MaxSpeed
	self.autoPilot.MaxSteeringAngle = AUTO_PILOT_DEFAULT_MAX_STEERING_ANGLE

	-- VehicleSeat should have a MaxSteeringAngle as well.
	-- Or we could look for a child "AutoPilotConfigModule" to find these values
	-- Or allow developer to set them through the API as like the CLickToMove customization API
end

return VehicleController
--[[ 
 Better don't change anything. This script is WIP v.0.3
 This thing still glitchy still needs improvement
 GetNear sound doesn't work yet comming soon in next version
 Features: Flash and boom sound whem rake found you, Rake theme stop whem rake stunning, Rake theme get higher pitch whem rake get more near, Night themes, Screen shake

 Don't edit pass this line you may break the whole script ]]
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
function StartSound()
NightTheme:Pause()
Found:Play()
FlashEffect.BackgroundTransparency = 0.6
wait(0.4)
ScreenShake.Disabled = false
FlashEffect.BackgroundTransparency = 1
RakeTheme:Play()	
end

function StopSound()
ScreenShake.Disabled = true
FlashEffect.BackgroundTransparency = 1
RakeTheme:Stop()
NightTheme:Play()
game.Workspace.CurrentCamera.FieldOfView = 70
end

function UpdateNightThemeID()
local RandomNTIDS = math.random(1,#NightThemeIDS)
local ChosenNTID = NightThemeIDS[RandomNTIDS]
--	local CKey = { KeyStates[KeyMap.Flip.PrimaryKey] or KeyStates[KeyMap.Flip.SecondaryKey] }
--	if CKey then
--		Input.Flip = 0
--	else
--		Input.Flip = 1
--	end
end
	
UIS.InputBegan:Connect(function(InputObj)
	--if InputObj.UserInputType == Enum.UserInputType.Keyboard then
		KeyStates[InputObj.KeyCode] = true
		KeyChanged()
	--end
end)

UIS.InputEnded:Connect(function(InputObj)
	--if InputObj.UserInputType == Enum.UserInputType.Keyboard then
		KeyStates[InputObj.KeyCode] = false
		KeyChanged()
	--end
end)

UIS.InputChanged:Connect(function(InputObj)
	if Input.InputMode == "Gamepad" then --Search for gamepad input
		if UIS.GamepadEnabled then
			local State = UIS:GetGamepadState(Enum.UserInputType.Gamepad1)
			local Stick1 = 0
			local RT1 = 0
			local LT1 = 0
			for i,v in pairs(State) do
				if v.KeyCode == Enum.KeyCode.ButtonR2 then
					RT1 = v.Position
				elseif v.KeyCode == Enum.KeyCode.ButtonL2 then
					LT1 = v.Position
				elseif v.KeyCode == Enum.KeyCode.Thumbstick1 then
					Stick1 = v.Position
					--if math.abs(Stick1)<0.18 then Stick1 = 0 else
					--	Stick1 = 1.18*Stick1 - 0.18*math.sign(Stick1)
					--end
				end
			end
			Input.Triggers = RT1.Z - LT1.Z
			Input.LStickY = Stick1.Y
			Input.LStickX = -Stick1.X
		end
	end
end)
		
return Input
--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