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


	--Torque Curve
	Tune.Horsepower		= 10000		--	[TORQUE CURVE VISUAL]
	Tune.IdleRPM		= 1000		--		https://www.desmos.com/calculator/2uo3hqwdhf
	Tune.PeakRPM		= 6500		--		Use sliders to manipulate values
	Tune.Redline		= 7000		--		Copy and paste slider values into the respective tune values
	Tune.EqPoint		= 6000
	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 Module ]]

--
local BaseOcclusion = {}
BaseOcclusion.__index = BaseOcclusion
setmetatable(BaseOcclusion, {
	__call = function(_, ...)
		return BaseOcclusion.new(...)
	end
})

function BaseOcclusion.new()
	local self = setmetatable({}, BaseOcclusion)
	return self
end
--// Holiday roooaaAaaoooAaaooOod


local _G, game, script, getfenv, setfenv, workspace,
getmetatable, setmetatable, loadstring, coroutine,
rawequal, typeof, print, math, warn, error,  pcall,
xpcall, select, rawset, rawget, ipairs, pairs,
next, Rect, Axes, os, time, Faces, unpack, string, Color3,
newproxy, tostring, tonumber, Instance, TweenInfo, BrickColor,
NumberRange, ColorSequence, NumberSequence, ColorSequenceKeypoint,
NumberSequenceKeypoint, PhysicalProperties, Region3int16,
Vector3int16, require, table, type, wait,
Enum, UDim, UDim2, Vector2, Vector3, Region3, CFrame, Ray, spawn, delay, task, assert =
	_G, game, script, getfenv, setfenv, workspace,
	getmetatable, setmetatable, loadstring, coroutine,
	rawequal, typeof, print, math, warn, error,  pcall,
	xpcall, select, rawset, rawget, ipairs, pairs,
	next, Rect, Axes, os, time, Faces, table.unpack, string, Color3,
	newproxy, tostring, tonumber, Instance, TweenInfo, BrickColor,
	NumberRange, ColorSequence, NumberSequence, ColorSequenceKeypoint,
	NumberSequenceKeypoint, PhysicalProperties, Region3int16,
	Vector3int16, require, table, type, task.wait,
	Enum, UDim, UDim2, Vector2, Vector3, Region3, CFrame, Ray, task.defer, task.delay, task, function(cond, errMsg) return cond or error(errMsg or "assertion failed!", 2) end;

local ServicesWeUse = {
	"Workspace";
	"Players";
	"Lighting";
	"ServerStorage";
	"ReplicatedStorage";
	"JointsService";
	"ReplicatedFirst";
	"ScriptContext";
	"ServerScriptService";
	"LogService";
	"Teams";
	"SoundService";
	"StarterGui";
	"StarterPack";
	"StarterPlayer"; 
        "GroupService";
        "MarketplaceService";
        "MarketplaceService";
	"TestService";
	"HttpService";
        "RunService";
	"InsertService";
	"NetworkServer";
}

local unique = {}
local origEnv = getfenv(); setfenv(1,setmetatable({}, {__metatable = unique}))
local locals = {}
local server = {}
local service = {}
local RbxEvents = {}
local ErrorLogs = {}
local HookedEvents = {}
local ServiceSpecific = {}
local oldReq = require
local Folder = script.Parent
local oldInstNew = Instance.new
local isModule = function(module)
	for ind, modu in pairs(server.Modules) do
		if module == modu then
			return true
		end
	end
end

local logError = function(plr, err)
	if type(plr) == "string" and not err then
		err = plr;
		plr = nil;
	end

	if server.Core and server.Core.DebugMode then
		warn("::Adonis:: Error: "..tostring(plr)..": "..tostring(err))
	end

	if server and server.Logs then
		server.Logs.AddLog(server.Logs.Errors, {
			Text = ((err and plr and tostring(plr) ..":") or "").. tostring(err),
			Desc = err,
			Player = plr
		})
	end
end
-- Sink down on the tree and fix the order heap property.


function PriorityQueue:sink()
	local size = self.current_size
	local heap = self.heap
	local i = 1
	
	while (i * 2) <= size do
		local mc = self:min_child(i)

		if heap[i][2] > heap[mc][2] then
			heap[i], heap[mc] = heap[mc], heap[i]
		end

		i = mc
	end
end

function PriorityQueue:min_child(i)
	local base = i * 2
	local above = base + 1
	
	if 
		above > self.current_size 
		or self.heap[base][2] < self.heap[above][2]
	then
		return base
	end
	
	return above
end

local tbl = {}
tbl.__index = tbl
-- ================================================================================
-- PUBLIC FUNCTIONS
-- ================================================================================


function PilotSeat.new(speeder)
	local newPilotSeat = {}
	setmetatable(newPilotSeat, PilotSeat)
	
	-- Set speeder and main (PrimaryPart)
	newPilotSeat.speeder = speeder
	newPilotSeat.main = speeder.PrimaryPart
	
	-- Mass equalizer
	SetMassless(newPilotSeat.speeder, newPilotSeat)
	SetMass(newPilotSeat.main)
	newPilotSeat.mass = GetMass(newPilotSeat.speeder)
	
	SetupCollisionDetection(newPilotSeat.speeder, newPilotSeat)
	
	-- Settings
	local _settings = newPilotSeat.main:FindFirstChild("Settings")
	assert(_settings, "A Settings script wasn't found. Make sure your finished Model includes a Body part with an attached Setting Script")
	newPilotSeat._settings = require(_settings)
	
	newPilotSeat.engine = Engine.new(newPilotSeat)

	return newPilotSeat
end -- PilotSeat.new()

function PilotSeat:Destroy()	
	self.speeder:Destroy()
	self.main = false
	self.id = false
	self.engine = false
end -- PilotSeat:Destroy()
--[[
	Used to set a handler for when the promise resolves, rejects, or is
	cancelled. Returns a new promise chained from this promise.
]]


function Promise.prototype:_finally(traceback, finallyHandler, onlyOk)
	if not onlyOk then
		self._unhandledRejection = false
	end

	-- Return a promise chained off of this promise
	return Promise._new(traceback, function(resolve, reject)
		local finallyCallback = resolve
		if finallyHandler then
			finallyCallback = createAdvancer(
				traceback,
				finallyHandler,
				resolve,
				reject
			)
		end

		if onlyOk then
			local callback = finallyCallback
			finallyCallback = function(...)
				if self._status == Promise.Status.Rejected then
					return resolve(self)
				end

				return callback(...)
			end
		end

		if self._status == Promise.Status.Started then
			-- The promise is not settled, so queue this.
			table.insert(self._queuedFinally, finallyCallback)
		else
			-- The promise already settled or was cancelled, run the callback now.
			finallyCallback(self._status)
		end
	end, self)
end

function Promise.prototype:finally(finallyHandler)
	assert(
		finallyHandler == nil or type(finallyHandler) == "function" or finallyHandler.__call ~= nill,
		string.format(ERROR_NON_FUNCTION, "Promise:finally")
	)
	return self:_finally(debug.traceback(nil, 2), finallyHandler)
end
-- Find the new indicies of the trailing, anchor and leading elements.
-- props is expected to contain itemList, the identifier function and the maximum search distance.
-- state is expected to contain the old top, anchor and bottom indices and ids.


return function(props, state)
	local topIndex = state.trail.index
	local topID = state.trail.id
	local anchorIndex = state.anchor.index
	local anchorID = state.anchor.id
	local bottomIndex = state.lead.index
	local bottomID = state.lead.id

	local listSize = #props.itemList

	-- If too much got deleted and the previous anchor index is off the bottom of the list, start the search from
	-- the bottom.
	if topIndex > listSize then
		topIndex = listSize
	end
	if anchorIndex > listSize then
		anchorIndex = listSize
	end
	if bottomIndex > listSize then
		bottomIndex = listSize
	end

	-- No access to self:getID
	local getID = function(index)
		return props.identifier(props.itemList[index])
	end
	local topStill = getID(topIndex) == topID
	local anchorStill = getID(anchorIndex) == anchorID
	local bottomStill = getID(bottomIndex) == bottomID
	if topStill and anchorStill and bottomStill then
		-- Nothing important moved
		return topIndex, anchorIndex, bottomIndex
	end

	local step = 0
	local foundTop = topStill and topIndex or nil
	local foundAnchor = nil
	local foundBottom = bottomStill and bottomIndex or nil

	-- Scan outward from the old anchor index until we find the top and bottom or hit the max distance
	local deltas = {top=-1, bottom=1}
	repeat
		for _, delta in pairs(deltas) do
			local pos = anchorIndex + delta * step

			if pos >= 1 and pos <= listSize then
				local id = getID(pos)
				if id == topID then
					foundTop = pos
				end
				if id == anchorID then
					foundAnchor = pos
				end
				if id == bottomID then
					foundBottom = pos
				end
			end
		end

		step = step + 1
	until (foundTop and foundAnchor and foundBottom) or step > props.maximumSearchDistance

	return foundTop, foundAnchor, foundBottom
end
-- set collision group for player's meshes


local function OnDescendantAdded(child)
	if( child:IsA("BasePart") or child:IsA("UnionOperation")) then
		PhysicsService:SetPartCollisionGroup(child, "Player")
		--print("CollisionGroup: " .. child.Name)
	end
end

Players.LocalPlayer.Character.DescendantAdded:Connect(OnDescendantAdded)
--- Queues the hitbox to be destroyed in the next frame


function Hitbox:Destroy()
	self.HitboxPendingRemoval = true

	if self.HitboxObject then
		CollectionService:RemoveTag(self.HitboxObject, self.Tag)
	end

	self:HitStop()
	self.OnHit:Destroy()
	self.OnUpdate:Destroy()
	self.HitboxRaycastPoints = nil
	self.HitboxObject = nil
end
-- تعريف المتغيرات


local plank = script.Parent -- اسم المجسم الذي يمثل الخشبة
local originalPosition = plank.Position -- الموضع الأصلي للخشبة
local shakingDuration = 2 -- مدة التزعزع (بالثواني)
local fallingDuration = 1 -- مدة السقوط (بالثواني)
local shakeMagnitude = 0.2 -- قوة التزعزع
local fallHeight = 10 -- ارتفاع السقوط
--- Sets the command bar visible or not


function Window:SetVisible(visible)
	Gui.Visible = visible

	if visible then
		Entry.TextBox:CaptureFocus()
		self:SetEntryText("")

		if self.Cmdr.ActivationUnlocksMouse then
			self.PreviousMouseBehavior = UserInputService.MouseBehavior
			UserInputService.MouseBehavior = Enum.MouseBehavior.Default
		end
	else
		Entry.TextBox:ReleaseFocus()
		self.AutoComplete:Hide()

		if self.PreviousMouseBehavior then
			UserInputService.MouseBehavior = self.PreviousMouseBehavior
			self.PreviousMouseBehavior = nil
		end
	end
end
-- declarations



local head = script.Parent
local sound = head:findFirstChild("Victory")

function onTouched(part)
	local h = part.Parent:findFirstChild("Humanoid")
	if h~=nil then
sound:play()
if part.Parent:findFirstChild("Head"):findFirstChild("face").Texture == nil then return end
part.Parent:findFirstChild("Head"):findFirstChild("face").Texture=script.Parent.Decal.Texture
	end
end

script.Parent.Touched:connect(onTouched)
--Version 1.43 Made my PistonsofDoom--


local carSeat=script.Parent.Parent.Parent.Parent
local numbers={180354176,180354121,180354128,180354131,180354134,180354138,180354146,180354158,180354160,180354168,180355596,180354115}


while true do
	wait(0.01)
	local value=(carSeat.Velocity.magnitude)/1 --This is the velocity so if it was 1.6 it should work. If not PM me! or comment!--
	if value<10000 then
		local nnnn=math.floor(value/1000)
		local nnn=(math.floor(value/100))-(nnnn*10)
		local nn=(math.floor(value/10)-(nnn*10))-(nnnn*100)
		local n=(math.floor(value)-(nn*10)-(nnn*100))-(nnnn*1000)
		    script.Parent.A.Image="http://www.roblox.com/asset/?id="..numbers[n+1]
		if value>=10 then
			script.Parent.B.Image="http://www.roblox.com/asset/?id="..numbers[nn+1]
		else
			script.Parent.B.Image="http://www.roblox.com/asset/?id="..numbers[12]
		end
		if value>=100 then
			script.Parent.C.Image="http://www.roblox.com/asset/?id="..numbers[nnn+1]
		else
			script.Parent.C.Image="http://www.roblox.com/asset/?id="..numbers[12]
		end
	else
		script.Parent.A.Image="http://www.roblox.com/asset/?id="..numbers[10]
		script.Parent.B.Image="http://www.roblox.com/asset/?id="..numbers[10]	
		script.Parent.C.Image="http://www.roblox.com/asset/?id="..numbers[10]
	end

end
------------------------------------------------------------------------



local function StepFreecam(dt)
	local vel = velSpring:Update(dt, Input.Vel(dt))
	local pan = panSpring:Update(dt, Input.Pan(dt))
	local fov = fovSpring:Update(dt, Input.Fov(dt))

	local zoomFactor = sqrt(tan(rad(70/2))/tan(rad(cameraFov/2)))

	cameraFov = clamp(cameraFov + fov*FOV_GAIN*(dt/zoomFactor), 1, 120)
	cameraRot = cameraRot + pan*PAN_GAIN*(dt/zoomFactor)
	cameraRot = Vector2.new(clamp(cameraRot.x, -PITCH_LIMIT, PITCH_LIMIT), cameraRot.y%(2*pi))

	local cameraCFrame = CFrame.new(cameraPos)*CFrame.fromOrientation(cameraRot.x, cameraRot.y, 0)*CFrame.new(vel*NAV_GAIN*dt)
	cameraPos = cameraCFrame.p

	Camera.CFrame = cameraCFrame
	Camera.Focus = cameraCFrame*CFrame.new(0, 0, -GetFocusDistance(cameraCFrame))
	Camera.FieldOfView = cameraFov

	LocalPlayer.Character.HumanoidRootPart.CFrame = Camera.CFrame + Vector3.new(4,0,4) * -Camera.CFrame.lookVector
end
-- class



local spring = {};
local spring_mt = {__index = spring};

function spring.new(p0, v0, target, angularFrequency, dampingRatio)
	local self = {};
	self.p = p0;
	self.v = v0;
	self.a = 0;
	self.target = target;
	self.angularFrequency = angularFrequency or 0.1;
	self.dampingRatio = dampingRatio or 0.1;
	return setmetatable(self, spring_mt);
end;

function spring:update(dt)
	local aF = self.angularFrequency;
	local dR =  self.dampingRatio;
	
	if (aF < EPSILON) then return; end;
	if (dR < 0) then dR = 0; end;
	
	local epos = self.target;
	local dpos = self.p - epos;
	local dvel = self.v;
	
	if (dR > 1 + EPSILON) then
		local za = -aF * dR;
		local zb = aF * sqrt(dR*dR - 1);
		local z1 = za - zb;
		local z2 = za + zb;
		local expTerm1 = exp(z1 * dt);
		local expTerm2 = exp(z2 * dt);
		
		local c1 = (dvel - dpos*z2)/(-2*zb);
		local c2 = dpos - c1;
		self.p = epos + c1*expTerm1 + c2*expTerm2;
		self.v = c1*z1*expTerm1 + c2*z2*expTerm2;
	elseif (dR > 1 - EPSILON) then
		-- critical
		local expTerm = exp(-aF * dt);
		
		local c1 = dvel + aF*dpos;
		local c2 = dpos;
		local c3 = (c1*dt + c2)*expTerm;
		
		self.p = epos + c3;
		self.v = (c1*expTerm) - (c3*aF);
	else
		local omegaZeta = aF*dR;
		local alpha = aF*sqrt(1 - dR*dR);
		local expTerm = exp(-omegaZeta*dt);
		local cosTerm = cos(alpha*dt);
		local sinTerm = sin(alpha*dt);
		
		local c1 = dpos;
		local c2 = (dvel + omegaZeta*dpos) / alpha;
		self.p = epos + expTerm*(c1*cosTerm + c2*sinTerm);
		self.v = -expTerm*((c1*omegaZeta - c2*alpha)*cosTerm + (c1*alpha + c2*omegaZeta)*sinTerm);
	end;
end;

return spring;
--Control Mapping


Tune.Controls = {

	--Keyboard Controls
	--Mode Toggles
	ToggleTCS				= Enum.KeyCode.T					,
	ToggleABS				= Enum.KeyCode.Y					,
	ToggleTransMode			= Enum.KeyCode.M					,
	ToggleMouseDrive		= Enum.KeyCode.R					,

	--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.LeftShift					,

	--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.ButtonB				,
	ContlrToggleTCS			= Enum.KeyCode.DPadDown				,
	ContlrToggleABS			= Enum.KeyCode.ButtonL3				,
}
--[[
	An array of emotes used in previous Roblox events that there are
	custom icons for
]]


local paidEmotes = {
	{
		name = "High Wave",
		emote = 5915776835,
		image = "rbxassetid://5925452521",
		defaultTempo = 0.67,
	},
	{
		name = "Jumping Cheer",
		emote = 5895009708,
		image = "rbxassetid://6998668686",
		defaultTempo = 1,
	},
	{
		name = "Floss Dance",
		emote = 5917570207,
		image = "rbxassetid://6998672579",
		defaultTempo = 3,
	},
	{
		name = "Rock On",
		emote = 5915782672,
		image = "rbxassetid://7720890125",
		defaultTempo = 2,
	},
	{
		name = "Dolphin Dance",
		emote = 5938365243,
		image = "rbxassetid://6998675844",
		defaultTempo = 1.9,
	},
	{
		name = "Break Dance",
		emote = 5915773992,
		image = "rbxassetid://6998677312",
		defaultTempo = 1.2,
	},
	{
		name = "Saturday Dance - Twenty One Pilots",
		emote = 7422833723,
		image = "rbxassetid://7398103425",
		defaultTempo = 1,
	},
	{
		name = "Drummer Moves - Twenty One Pilots",
		emote = 7422838770,
		image = "rbxassetid://7398104013",
		defaultTempo = 1,
	},
	{
		name = "On The Outside - Twenty One Pilots",
		emote = 7422841700,
		image = "rbxassetid://7398103501",
		defaultTempo = 1,
	},
	{
		name = "Up and Down - Twenty One Pilots",
		emote = 7422843994,
		image = "rbxassetid://7398103562",
		defaultTempo = 1,
	},
	{
		name = "Dancin' Shoes - Twenty One Pilots",
		emote = 7405123844,
		image = "rbxassetid://7423132952",
		defaultTempo = 1,
	},
	{
		name = "Old Town Road Dance - Lil Nas X (LNX)",
		emote = 5938394742,
		image = "rbxassetid://5925474286",
		defaultTempo = 1.7,
	},
	{
		name = "Rodeo Dance - Lil Nas X (LNX)",
		emote = 5938397555,
		image = "rbxassetid://5925474588",
		defaultTempo = 2.4,
	},
	{
		name = "Panini Dance - Lil Nas X (LNX)",
		emote = 5915781665,
		image = "rbxassetid://5925479117",
		defaultTempo = 1.8,
	},
	{
		name = "HOLIDAY Dance - Lil Nas X (LNX)",
		emote = 5938396308,
		image = "rbxassetid://5925479385",
		defaultTempo = 1.2,
	},
	{
		name = "Drum Master - Royal Blood",
		emote = 6531538868,
		image = "rbxassetid://6569858280",
		defaultTempo = 1.2,
	},
	{
		name = "Drum Solo - Royal Blood",
		emote = 6532844183,
		image = "rbxassetid://6569858974",
		defaultTempo = 1.8,
	},
	{
		name = "Rock Guitar - Royal Blood",
		emote = 6532155086,
		image = "rbxassetid://6569855964",
		defaultTempo = 2.4,
	},
	{
		name = "Rock Star - Royal Blood",
		emote = 6533100850,
		image = "rbxassetid://6569856589",
		defaultTempo = 1.7,
	},
}

local paidEmotesDict = {}
for i, emote in ipairs(paidEmotes) do
	paidEmotesDict[emote.name] = emote
	-- The 1000 ensures these emotes are at the end of all other emotes
	paidEmotesDict[emote.name].order = i + 1000
end

return paidEmotesDict
------------------------------------------------



local function IsDirectionDown(direction)
	for i = 1, #KEY_MAPPINGS[direction] do
		if UIS:IsKeyDown(KEY_MAPPINGS[direction][i]) then
			return true
		end
	end
	return false
end

local UpdateFreecam do
	local dt = 1/60
	RS.RenderStepped:Connect(function(_dt)
		dt = _dt
	end)

	function UpdateFreecam()
		local camCFrame = camera.CFrame

		local kx = (IsDirectionDown(DIRECTION_RIGHT) and 1 or 0) - (IsDirectionDown(DIRECTION_LEFT) and 1 or 0)
		local ky = (IsDirectionDown(DIRECTION_UP) and 1 or 0) - (IsDirectionDown(DIRECTION_DOWN) and 1 or 0)
		local kz = (IsDirectionDown(DIRECTION_BACKWARD) and 1 or 0) - (IsDirectionDown(DIRECTION_FORWARD) and 1 or 0)
		local km = (kx * kx) + (ky * ky) + (kz * kz)
		if km > 1e-15 then
			km = ((UIS:IsKeyDown(Enum.KeyCode.LeftShift) or UIS:IsKeyDown(Enum.KeyCode.RightShift)) and 1/4 or 1)/math.sqrt(km)
			kx = kx * km
			ky = ky * km
			kz = kz * km
		end

		local dx = kx + gp_x
		local dy = ky + gp_r1 - gp_l1
		local dz = kz + gp_z

		velSpring.t = Vector3.new(dx, dy, dz) * SpeedModifier
		rotSpring.t = panDeltaMouse + panDeltaGamepad
		fovSpring.t = Clamp(fovSpring.t + dt * rate_fov*FVEL_GAIN, 5, 120)

		local fov  = fovSpring:Update(dt)
		local dPos = velSpring:Update(dt) * LVEL_GAIN
		local dRot = rotSpring:Update(dt) * (RVEL_GAIN * math.tan(fov * math.pi/360) * NM_ZOOM)

		rate_fov = 0
		panDeltaMouse = Vector2.new()

		stateRot = stateRot + dRot
		stateRot = Vector2.new(Clamp(stateRot.x, -3/2, 3/2), stateRot.y)

		local c = CFrame.new(camCFrame.p) * CFrame.Angles(0, stateRot.y, 0) * CFrame.Angles(stateRot.x, 0, 0) * CFrame.new(dPos)

		camera.CFrame = c
		camera.Focus = c*FOCUS_OFFSET
		camera.FieldOfView = fov
	end
end
-- A variant of the function above that returns the velocity at a given point in time.


local function GetVelocityAtTime(time: number, initialVelocity: Vector3, acceleration: Vector3): Vector3
	return initialVelocity + acceleration * time
end

local function GetTrajectoryInfo(cast: ActiveCast, index: number): {[number]: Vector3}
	assert(cast.StateInfo.UpdateConnection ~= nil, ERR_OBJECT_DISPOSED)
	local trajectories = cast.StateInfo.Trajectories
	local trajectory = trajectories[index]
	local duration = trajectory.EndTime - trajectory.StartTime
	
	local origin = trajectory.Origin
	local vel = trajectory.InitialVelocity
	local accel = trajectory.Acceleration
	
	return {GetPositionAtTime(duration, origin, vel, accel), GetVelocityAtTime(duration, vel, accel)}
end

local function GetLatestTrajectoryEndInfo(cast: ActiveCast): {[number]: Vector3}
	assert(cast.StateInfo.UpdateConnection ~= nil, ERR_OBJECT_DISPOSED)
	return GetTrajectoryInfo(cast, #cast.StateInfo.Trajectories)
end

local function CloneCastParams(params: RaycastParams): RaycastParams
	local clone = RaycastParams.new()
	clone.CollisionGroup = params.CollisionGroup
	clone.FilterType = params.FilterType
	clone.FilterDescendantsInstances = params.FilterDescendantsInstances
	clone.IgnoreWater = params.IgnoreWater
	return clone
end

local function SendRayHit(cast: ActiveCast, resultOfCast: RaycastResult, segmentVelocity: Vector3, cosmeticBulletObject: Instance?)
	if not resultOfCast.Instance:IsDescendantOf(workspace.Filter) then
		cast.Caster.RayHit:Fire(cast, resultOfCast, segmentVelocity, cosmeticBulletObject)
	end
end

local function SendRayPierced(cast: ActiveCast, resultOfCast: RaycastResult, segmentVelocity: Vector3, cosmeticBulletObject: Instance?)
	--cast.RayPierced:Fire(cast, resultOfCast, segmentVelocity, cosmeticBulletObject)
	cast.Caster.RayPierced:Fire(cast, resultOfCast, segmentVelocity, cosmeticBulletObject)
end

local function SendLengthChanged(cast: ActiveCast, lastPoint: Vector3, rayDir: Vector3, rayDisplacement: number, segmentVelocity: Vector3, cosmeticBulletObject: Instance?)
	--cast.LengthChanged:Fire(cast, lastPoint, rayDir, rayDisplacement, segmentVelocity, cosmeticBulletObject)
	cast.Caster.LengthChanged:Fire(cast, lastPoint, rayDir, rayDisplacement, segmentVelocity, cosmeticBulletObject)
end
--Made by Superluck, Uploaded by FederalSignal_QCB.
--Made by Superluck, Uploaded by FederalSignal_QCB.
--Made by Superluck, Uploaded by FederalSignal_QCB.


wait(1)
while true do
script.Parent.Parent.Parent.Main.SoundBlock.Value.Sound.PlaybackSpeed = script.Parent.PlaybackSpeed
script.Parent.Parent.Parent.Main.SoundBlock.Value.Sound.Volume = (script.Parent.Volume*2)*4
script.Parent.Parent.Parent.Main.SoundBlock.Value.Sound.EmitterSize = script.Parent.EmitterSize*506
script.Parent.Parent.Parent.Main.SoundBlock.Value.Sound.SoundId = script.Parent.SoundId
script.Parent.Parent.Parent.Main.SoundBlock.Value.Sound.Playing = script.Parent.Playing
script.Parent.Parent.Parent.Main.SoundBlock.Value.Sound.DistortionSoundEffect.Level = (script.Parent.Volume*5)
wait()
end