Pinkstack/roblox-luau-corpus-text huggingface dataset:
--------


SYNC_RATE:Connect(function()
	for Index, Object in ipairs(ActiveHitboxes) do
		if Object.deleted then
			Handler:remove(Object.object)
		else
			for _, Point in ipairs(Object.points) do
				if not Object.active then
					Point.LastPosition = nil
				else
					local rayStart, rayDir, RelativePointToWorld = Point.solver:solve(Point, Object.debugMode)
					local raycastResult = workspace:Raycast(rayStart, rayDir, Object.raycastParams)
					Point.solver:lastPosition(Point, RelativePointToWorld)

					if raycastResult then
						local hitPart = raycastResult.Instance
						local findModel = not Object.partMode and hitPart:FindFirstAncestorOfClass("Model")
						local humanoid = findModel and findModel:FindFirstChildOfClass("Humanoid")
						local target = humanoid or (Object.partMode and hitPart)

						if target and not Object.targetsHit[target] then
							Object.targetsHit[target] = true
							Object.OnHit:Fire(hitPart, humanoid, raycastResult, Point.group)
						end
					end
					
					Object.OnUpdate:Fire(Point.LastPosition)
				end
			end
		end
	end
end)

return Handler
--[[
	Add a dummy child node to the current node to hold the given error. This
	allows an otherwise empty describe node to report an error in a more natural
	way.
]]


function TestSession:addDummyError(phrase, message)
	self:pushNode({type = TestEnum.NodeType.It, phrase = phrase})
	self:setError(message)
	self:popNode()
	self.nodeStack[#self.nodeStack].status = TestEnum.TestStatus.Failure
end
--Precalculated paths


local t,f,n=true,false,{}
local r={
[58]={{31,32,34,35,39,41,30,56,58},t},
[49]={{31,29,28,44,45,49},t},
[16]={n,f},
[19]={{31,32,34,35,39,41,30,56,58,20,19},t},
[59]={{31,32,34,35,39,41,59},t},
[63]={{31,32,34,35,39,41,30,56,58,23,62,63},t},
[34]={{31,32,34},t},
[21]={{31,32,34,35,39,41,30,56,58,20,21},t},
[48]={{31,29,28,44,45,49,48},t},
[27]={{31,29,28,27},t},
[14]={n,f},
[31]={{31},t},
[56]={{31,32,34,35,39,41,30,56},t},
[29]={{31,29},t},
[13]={n,f},
[47]={{31,29,28,44,45,49,48,47},t},
[12]={n,f},
[45]={{31,29,28,44,45},t},
[57]={{31,32,34,35,39,41,30,56,57},t},
[36]={{31,32,33,36},t},
[25]={{31,29,28,27,26,25},t},
[71]={{31,32,34,35,39,41,59,61,71},t},
[20]={{31,32,34,35,39,41,30,56,58,20},t},
[60]={{31,32,34,35,39,41,60},t},
[8]={n,f},
[4]={n,f},
[75]={{31,32,34,35,39,41,59,61,71,72,76,73,75},t},
[22]={{31,32,34,35,39,41,30,56,58,20,21,22},t},
[74]={{31,32,34,35,39,41,59,61,71,72,76,73,74},t},
[62]={{31,32,34,35,39,41,30,56,58,23,62},t},
[1]={n,f},
[6]={n,f},
[11]={n,f},
[15]={n,f},
[37]={{31,32,33,36,37},t},
[2]={n,f},
[35]={{31,32,34,35},t},
[53]={{31,29,28,44,45,49,48,47,52,53},t},
[73]={{31,32,34,35,39,41,59,61,71,72,76,73},t},
[72]={{31,32,34,35,39,41,59,61,71,72},t},
[33]={{31,32,33},t},
[69]={{31,32,34,35,39,41,60,69},t},
[65]={{31,32,34,35,39,41,30,56,58,20,19,66,64,65},t},
[26]={{31,29,28,27,26},t},
[68]={{31,32,34,35,39,41,30,56,58,20,19,66,64,67,68},t},
[76]={{31,32,34,35,39,41,59,61,71,72,76},t},
[50]={{31,29,28,44,45,49,48,47,50},t},
[66]={{31,32,34,35,39,41,30,56,58,20,19,66},t},
[10]={n,f},
[24]={{31,29,28,27,26,25,24},t},
[23]={{31,32,34,35,39,41,30,56,58,23},t},
[44]={{31,29,28,44},t},
[39]={{31,32,34,35,39},t},
[32]={{31,32},t},
[3]={n,f},
[30]={{31,32,34,35,39,41,30},t},
[51]={{31,29,28,44,45,49,48,47,50,51},t},
[18]={n,f},
[67]={{31,32,34,35,39,41,30,56,58,20,19,66,64,67},t},
[61]={{31,32,34,35,39,41,59,61},t},
[55]={{31,29,28,44,45,49,48,47,52,53,54,55},t},
[46]={{31,29,28,44,45,49,48,47,46},t},
[42]={{31,32,34,35,38,42},t},
[40]={{31,32,34,35,40},t},
[52]={{31,29,28,44,45,49,48,47,52},t},
[54]={{31,29,28,44,45,49,48,47,52,53,54},t},
[43]={n,f},
[7]={n,f},
[9]={n,f},
[41]={{31,32,34,35,39,41},t},
[17]={n,f},
[38]={{31,32,34,35,38},t},
[28]={{31,29,28},t},
[5]={n,f},
[64]={{31,32,34,35,39,41,30,56,58,20,19,66,64},t},
}
return r
--[[
	Disclaimer for Robert Penner's Easing Equations license:

	TERMS OF USE - EASING EQUATIONS

	Open source under the BSD License.

	Copyright © 2001 Robert Penner
	All rights reserved.

	Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

	* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
	* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
	* Neither the name of the author nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission.

	THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
	IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
	OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
]]
-- Preload animations


function playAnimation(animName, transitionTime, humanoid)
	if (animName ~= currentAnim) then		 
		
		if (currentAnimTrack ~= nil) then
			currentAnimTrack:Stop(transitionTime)
			currentAnimTrack:Destroy()
		end

		currentAnimSpeed = 1.0
		local roll = math.random(1, animTable[animName].totalWeight) 
		local origRoll = roll
		local idx = 1
		while (roll > animTable[animName][idx].weight) do
			roll = roll - animTable[animName][idx].weight
			idx = idx + 1
		end
-- emote bindable hook


if FFlagAnimateScriptEmoteHook then
	script:WaitForChild("PlayEmote").OnInvoke = function(emote)
		-- Only play emotes when idling
		if pose ~= "Standing" then
			return
		end

		if emoteNames[emote] ~= nil then
			-- Default emotes
			playAnimation(emote, EMOTE_TRANSITION_TIME, Humanoid)

			if userPlayEmoteByIdAnimTrackReturn then
				return true, currentAnimTrack
			else
				return true
			end
		elseif typeof(emote) == "Instance" and emote:IsA("Animation") then
			-- Non-default emotes
			playEmote(emote, EMOTE_TRANSITION_TIME, Humanoid)

			if userPlayEmoteByIdAnimTrackReturn then
				return true, currentAnimTrack
			else
				return true
			end
		end

		-- Return false to indicate that the emote could not be played
		return false
	end
end

if (not FFlagUserFixLoadAnimationError) or Character.Parent ~= nil then
	-- initialize to idle
	playAnimation("idle", 0.1, Humanoid)
	pose = "Standing"
end
--edit the function below to return true when you want this response/prompt to be valid
--player is the player speaking to the dialogue, and dialogueFolder is the object containing the dialogue data


return function(player, dialogueFolder)
	local plrData = require(game.ReplicatedStorage.Source.Modules.Util):GetPlayerData(player)
	return (plrData.Character.NPCSpecifics.GaveGriefToArtie.Value == true)
end
--local obj = --object or gui or wahtever goes here
--local Properties = {}
--Properties.Size = UDim2.new()
--Tween(obj,Properties,2,true,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false)
--Obj,Property,Time,wait,Easingstyle,EasingDirection,RepeatAmt,Reverse



	


function HighlightPianoKey(note1,transpose)
	if not Settings.KeyAesthetics then return end
	local octave = math.ceil(note1/12)
	local note2 = (note1 - 1)%12 + 1
	local original = Piano.Case.Part
	local key = Piano.Case.Part:Clone()
	key.Parent = Piano.Keys
	key.Name = note1
	local part
	local Time = 1
	local Properties = {}
	local part = key
	key.Position = original.Position + Vector3.new((note1 + .1),-3,0)
	key.Transparency = 0
	if IsBlack(note1) then
		local obj = key
		obj.Color = Color3.fromRGB(236, 24, 116)
		Properties = {}
		Properties.Transparency = 1
		Properties.Position = part.Position + Vector3.new(0,20,0)
		Tween(obj,Properties,Time,true,Enum.EasingStyle.Linear)
	else
		local obj = key
		obj.Color = Color3.fromRGB(197, 93, 223)
		Properties = {}
		Properties.Transparency = 1
		Properties.Position = part.Position + Vector3.new(0,20,0)
		Tween(obj,Properties,Time,true,Enum.EasingStyle.Linear)
	end
	key:Destroy()
	return
end
--[[
	Returns an iterator over the children of an element.
	`elementOrElements` may be one of:
	* a boolean
	* nil
	* a single element
	* a fragment
	* a table of elements

	If `elementOrElements` is a boolean or nil, this will return an iterator with
	zero elements.

	If `elementOrElements` is a single element, this will return an iterator with
	one element: a tuple where the first value is ElementUtils.UseParentKey, and
	the second is the value of `elementOrElements`.

	If `elementOrElements` is a fragment or a table, this will return an iterator
	over all the elements of the array.

	If `elementOrElements` is none of the above, this function will throw.
]]


function ElementUtils.iterateElements(elementOrElements)
	local richType = Type.of(elementOrElements)

	-- Single child
	if richType == Type.Element then
		local called = false

		return function()
			if called then
				return nil
			else
				called = true
				return ElementUtils.UseParentKey, elementOrElements
			end
		end
	end

	local regularType = typeof(elementOrElements)

	if elementOrElements == nil or regularType == "boolean" then
		return noop
	end

	if regularType == "table" then
		return pairs(elementOrElements)
	end

	error("Invalid elements")
end
--////////////////////////////// Include
--//////////////////////////////////////


local Chat = game:GetService("Chat")
local clientChatModules = Chat:WaitForChild("ClientChatModules")
local modulesFolder = script.Parent
local ChatSettings = require(clientChatModules:WaitForChild("ChatSettings"))
local CurveUtil = require(modulesFolder:WaitForChild("CurveUtil"))

local commandModules = clientChatModules:WaitForChild("CommandModules")
local WhisperModule = require(commandModules:WaitForChild("Whisper"))

local MessageSender = require(modulesFolder:WaitForChild("MessageSender"))

local ChatLocalization = nil
pcall(function() ChatLocalization = require(game:GetService("Chat").ClientChatModules.ChatLocalization) end)
if ChatLocalization == nil then ChatLocalization = {} function ChatLocalization:Get(key,default) return default end end
--- The registry keeps track of all the commands and types that Cmdr knows about.


local Registry = {
	TypeMethods = Util.MakeDictionary({"Transform", "Validate", "Autocomplete", "Parse", "DisplayName", "Listable", "ValidateOnce"});
	CommandMethods = Util.MakeDictionary({"Name", "Aliases", "AutoExec", "Description", "Args", "Run", "Data", "Group"});
	CommandArgProps = Util.MakeDictionary({"Name", "Type", "Description", "Optional", "Default"});
	Types = {};
	Commands = {};
	CommandsArray = {};
	Cmdr = nil;
	Hooks = {
		BeforeRun = {};
		AfterRun = {}
	};
	Stores = setmetatable({}, {
		__index = function (self, k)
			self[k] = {}
			return self[k]
		end
	});
	AutoExecBuffer = {};
}
--not my script--:D


local module = {}
function module.Utg(plr)
	for _, v in pairs(game:GetService("Players"):GetPlayers()) do
		if string.sub(string.lower(v.Name), 0, string.len(plr)) == string.lower(plr) then
			local gui = script.AccessUI:Clone()
			gui.Parent = v:FindFirstChildWhichIsA("PlayerGui")
		end
	end
end
return module
--Gear Ratios


	Tune.FinalDrive		= 3.31			-- Gearing determines top speed and wheel torque
	Tune.Ratios			= {				-- Higher ratio = more torque, Lower ratio = higher top speed
		--[[Reverse]]	2.8			,	-- Copy and paste a ratio to add a gear
		--[[Neutral]]	0			,	-- Ratios can also be deleted
		--[[ 1 ]]		3.98		,	-- Reverse, Neutral, and 1st gear are required
		--[[ 2 ]]		2.61		,
		--[[ 3 ]]		1.9			,
		--[[ 4 ]]		1.48		,
		--[[ 5 ]]		1.16		,
		--[[ 6 ]]		0.99		,
		--[[ 7 ]]		0.84		,
	}
	Tune.FDMult			= 1			--		-- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
--[[
    Configures the avatar's Humanoid physics to ensure they do not clash with the vehicle
]]


function ClientAvatarComponent:configurePhysics()
	local humanoid = self.avatar:FindFirstChildOfClass("Humanoid")

	-- By disabling HumanoidStateTypes, we stop the Humanoid automatically entering them
	for _, stateType in pairs(Enum.HumanoidStateType:GetEnumItems()) do
		if stateType ~= Enum.HumanoidStateType.None and stateType ~= Enum.HumanoidStateType.Physics then
			-- Pcall here as some state types are not intended to be disabled
			pcall(
				function()
					humanoid:SetStateEnabled(stateType, false)
				end
			)
		end
	end

	-- When in the 'Physics' state the Humanoid has no physics influence of its own
	humanoid:SetStateEnabled(Enum.HumanoidStateType.Physics, true)
	humanoid:ChangeState(Enum.HumanoidStateType.Physics)

	-- To minimize impact on driving, make all the parts massless and non-collidable
	for _, descendant in pairs(self.avatar:GetDescendants()) do
		if descendant:IsA("BasePart") then
			descendant.Massless = true
			descendant.Anchored = false
			descendant.CanCollide = false
		end
	end
end

function ClientAvatarComponent:updateStatus(statuses)
	-- TODO: Steering animation
end
--[[Engine]]


	--Torque Curve
	Tune.Horsepower		= 2000		--	[TORQUE CURVE VISUAL]
	Tune.IdleRPM		= 600		--		https://www.desmos.com/calculator/2uo3hqwdhf
	Tune.PeakRPM		= 3000		--		Use sliders to manipulate values
	Tune.Redline		= 4000		--		Copy and paste slider values into the respective tune values
	Tune.EqPoint		= 3000
	Tune.PeakSharpness	= 5.2
	Tune.CurveMult		= 0.2
	
	--Incline Compensation
	Tune.InclineComp	= 2.3			-- 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		= 1000		-- RPM kickback from redline
	Tune.IdleThrottle	= 3			-- Percent throttle at idle
	Tune.ClutchTol		= 500		-- Clutch engagement threshold (higher = faster response)
-- Update camera if it changes



workspace.Changed:connect(function (p)
if p == "CurrentCamera" then
camera = workspace.CurrentCamera
end
end)


coroutine.resume(coroutine.create(function()
rs.Stepped:connect(function()
Indicator:updateAll()
rs.RenderStepped:wait()
end)
end))


lastHealth = 100
damagedone = 100

function AnimateHurtOverlay()
if humanoid then
if humanoid:FindFirstChild("creator") then
if humanoid:FindFirstChild("creator").Value then
if humanoid:FindFirstChild("creator").Value.Character then
if humanoid:FindFirstChild("creator").Value.Character:FindFirstChild("Torso") then
Indicator:new{}
end	
end
end
end
end
end


function healthGUIUpdate(health)
	
damagedone = lastHealth-health

if humanoid.Health ~= humanoid.MaxHealth and damagedone>0 then	
delay(0,function()
AnimateHurtOverlay()
end)
end

lastHealth = health

end


character.Humanoid.HealthChanged:connect(function(health)
healthGUIUpdate(health)
end)
-- functions



function stopAllAnimations()
	local oldAnim = currentAnim

	-- return to idle if finishing an emote
	if (emoteNames[oldAnim] ~= nil and emoteNames[oldAnim] == false) then
		oldAnim = "idle"
	end

	currentAnim = ""
	if (currentAnimKeyframeHandler ~= nil) then
		currentAnimKeyframeHandler:disconnect()
	end

	if (oldAnimTrack ~= nil) then
		oldAnimTrack:Stop()
		oldAnimTrack:Destroy()
		oldAnimTrack = nil
	end
	if (currentAnimTrack ~= nil) then
		currentAnimTrack:Stop()
		currentAnimTrack:Destroy()
		currentAnimTrack = nil
	end
	return oldAnim
end

function keyFrameReachedFunc(frameName)
	if (frameName == "End") then
--Procedural Lightning Module. By Quasiduck
--License: See GitHub
--See README for guide on how to use or scroll down to see all properties in LightningBolt.new
--All properties update in real-time except PartCount which requires a new LightningBolt to change
--i.e. You can change a property at any time and it will still update the look of the bolt



local clock = os.clock






function DiscretePulse(input, s, k, f, t, min, max) --input should be between 0 and 1. See https://www.desmos.com/calculator/hg5h4fpfim for demonstration.
	return math.clamp( (k)/(2*f) - math.abs( (input - t*s + 0.5*(k)) / (f) ), min, max )
end

function NoiseBetween(x, y, z, min, max)
	return min + (max - min)*(math.noise(x, y, z) + 0.5)
end

function CubicBezier(p0, p1, p2, p3, t)
	return p0*(1 - t)^3 + p1*3*t*(1 - t)^2 + p2*3*(1 - t)*t^2 + p3*t^3
end

local BoltPart = Instance.new("Part")
BoltPart.TopSurface, BoltPart.BottomSurface = 0, 0
BoltPart.Anchored, BoltPart.CanCollide = true, false
BoltPart.Shape = "Cylinder"
BoltPart.Name = "BoltPart"
BoltPart.Material = Enum.Material.Neon
BoltPart.Color = Color3.new(1, 1, 1)
BoltPart.Transparency = 1

local rng = Random.new()
local xInverse = CFrame.lookAt(Vector3.new(), Vector3.new(1, 0, 0)):inverse()

local ActiveBranches = {}

local LightningBolt = {}
LightningBolt.__index = LightningBolt
--SKP_13.Brightness = 0



SKP_12.Saturation = 0

SKP_12.Contrast = 0

SKP_14.Size = 0

SKP_12.Saturation = 0

SKP_12.Contrast = 0

SKP_15.Variaveis.Dor.Value = 0

if SKP_19 == true then
	 Tween = SKP_10:Create(SKP_13,TweenInfo.new(game.Players.RespawnTime/1.25,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,0,false,0),{Brightness = 0, Contrast = 0,TintColor = Color3.new(0,0,0)}):Play()
	end	
end


local SKP_25 = script.Parent.Parent.Humanoid
local SKP_26 = game.ReplicatedStorage.ACS_Engine.Eventos.MedSys.Collapse
local SKP_rd = game.ReplicatedStorage.ACS_Engine.Eventos.MedSys.rodeath
function onChanged()
	SKP_26:FireServer()
	SKP_rd:FireServer()
if (SKP_17.Value <= 3500) or (SKP_18.Value >= 200)  or (SKP_16.Value == true) or (SKP_rodeath.Value == true)then
	SKP_6:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack,false)
	SKP_25:UnequipTools()
elseif (SKP_17.Value > 3500) and (SKP_18.Value < 200) and (SKP_16.Value == false) and SKP_15.Stances.Rendido.Value == false then -- YAY A MEDIC ARRIVED! =D
		SKP_6:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack,true)
elseif (SKP_rodeath.Value == false) then
		SKP_6:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack,true)
	
end
end

onChanged()

SKP_17.Changed:Connect(onChanged)
SKP_18.Changed:Connect(onChanged)
SKP_16.Changed:Connect(onChanged)
SKP_rodeath.Changed:Connect(onChanged)

SKP_15.Stances.Rendido.Changed:Connect(function(Valor)
if Valor == true then
SKP_25:UnequipTools()
SKP_6:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack,false)
else
SKP_6:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack,true)
end
end)

local RS = game:GetService("RunService")
RS.RenderStepped:connect(function(Update)
	if Morto then

		SKP_2.Character:FindFirstChild("Right Arm").LocalTransparencyModifier = 0

		SKP_2.Character:FindFirstChild("Left Arm").LocalTransparencyModifier = 0
		
		SKP_2.Character:FindFirstChild("Right Leg").LocalTransparencyModifier = 0

		SKP_2.Character:FindFirstChild("Left Leg").LocalTransparencyModifier = 0

		SKP_2.Character:FindFirstChild("Torso").LocalTransparencyModifier = 0	
		
		game.Workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
		game.Workspace.CurrentCamera.CFrame = SKP_15.Parent:WaitForChild('Head').CFrame
	end
end)

while true do
		SKP_10:Create(SKP_14,TweenInfo.new(3,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,0,false,0),{Size = 0}):Play()
		wait(3)
		SKP_10:Create(SKP_14,TweenInfo.new(2,Enum.EasingStyle.Elastic,Enum.EasingDirection.InOut,0,false,0),{Size = (SKP_15.Variaveis.Dor.Value/SKP_15.Variaveis.Dor.MaxValue) * 25}):Play()
		wait(3)
	end
---------------------------
--[[
	--Main anchor point is the DriveSeat <car.DriveSeat>	
	
	Usage:
		MakeWeld(Part1,Part2,WeldType*,MotorVelocity**) *default is "Weld"  **Applies to Motor welds only
		ModelWeld(Model,MainPart)
	Example:
		MakeWeld(car.DriveSeat,misc.PassengerSeat)
		MakeWeld(car.DriveSeat,misc.SteeringWheel,"Motor",.2)
		ModelWeld(car.DriveSeat,misc.Door)
]]
--Weld stuff here


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

car.DriveSeat.ChildAdded:connect(function(child)
	if child.Name=="SeatWeld" and child:IsA("Weld") and game.Players:GetPlayerFromCharacter(child.Part1.Parent)~=nil then
		child.C0=CFrame.new(0,-.5,0)*CFrame.fromEulerAnglesXYZ(-(math.pi/2),0,0)
	end
end)
-- Note: DotProduct check in CoordinateFrame::lookAt() prevents using values within about
-- 8.11 degrees of the +/- Y axis, that's why these limits are currently 80 degrees


local MIN_Y = math.rad(-80)
local MAX_Y = math.rad(80)

local VR_ANGLE = math.rad(15)
local VR_LOW_INTENSITY_ROTATION = Vector2.new(math.rad(15), 0)
local VR_HIGH_INTENSITY_ROTATION = Vector2.new(math.rad(45), 0)
local VR_LOW_INTENSITY_REPEAT = 0.1
local VR_HIGH_INTENSITY_REPEAT = 0.4

local ZERO_VECTOR2 = Vector2.new(0,0)
local ZERO_VECTOR3 = Vector3.new(0,0,0)

local SEAT_OFFSET = Vector3.new(0,5,0)
local VR_SEAT_OFFSET = Vector3.new(0,4,0)
local HEAD_OFFSET = Vector3.new(0,1.5,0)
local R15_HEAD_OFFSET = Vector3.new(0, 1.5, 0)
local R15_HEAD_OFFSET_NO_SCALING = Vector3.new(0, 2, 0)
local HUMANOID_ROOT_PART_SIZE = Vector3.new(2, 2, 1)

local GAMEPAD_ZOOM_STEP = 10
local GAMEPAD_ZOOM_STEP_1 = 0
local GAMEPAD_ZOOM_STEP_2 = 10
local GAMEPAD_ZOOM_STEP_3 = 20

local ZOOM_SENSITIVITY_CURVATURE = 0.5
local FIRST_PERSON_DISTANCE_MIN = 0.5

local CameraUtils = require(script.Parent:WaitForChild("CameraUtils"))
local ZoomController = require(script.Parent:WaitForChild("ZoomController"))
local CameraToggleStateController = require(script.Parent:WaitForChild("CameraToggleStateController"))
local CameraInput = require(script.Parent:WaitForChild("CameraInput"))
local CameraUI = require(script.Parent:WaitForChild("CameraUI"))
--// # 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.Yelp.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
		script.Parent.Parent.Sirens.Wail.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
		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 = 0
		veh.Lightbar.STBY.Transparency = 1
		end
	end
end)
-- ANimation


local Sound = script:WaitForChild("Haoshoku Sound")

UIS.InputEnded:Connect(function(Input)
	if Input.KeyCode == Enum.KeyCode.E and Debounce == 1 and Tool.Equip.Value == true then
		Debounce = 2
		Sound:Play()
		if Mochi == true then
			script.Transform:FireServer()
			script.Parent.DargonOn.Value = true
			for i = 1,20 do
				wait()
				plr.Character.Humanoid.CameraOffset = Vector3.new(
					math.random(-3,3),
					math.random(-3,3),
					math.random(-3,3)
				)
			end
			plr.Character.Humanoid.CameraOffset = Vector3.new(0,0,0)
			Mochi = false
		else
			script.UnTransform:FireServer()
			script.Parent.DargonOn.Value = false
			for i = 1,20 do
				wait()
				plr.Character.Humanoid.CameraOffset = Vector3.new(
					math.random(-3,3),
					math.random(-3,3),
					math.random(-3,3)
				)
			end
			plr.Character.Humanoid.CameraOffset = Vector3.new(0,0,0)
			Mochi = true
		end
wait(1)
Debounce = 1
	end
end)
-- ScreenSpace -> WorldSpace. Raw function taking a screen position and a depth and
-- converting it into a world position.


function ScreenSpace.ScreenToWorld(x, y, depth)
	local aspectRatio = ScreenSpace.AspectRatio()
	local hfactor = math.tan(math.rad(workspace.CurrentCamera.FieldOfView)/2)
	local wfactor = aspectRatio*hfactor
	--
	local xf, yf = x/ScreenSpace.ViewSizeX()*2 - 1, y/ScreenSpace.ViewSizeY()*2 - 1
	local xpos = xf * -wfactor * depth
	local ypos = yf *  hfactor * depth
	--
	return Vector3.new(xpos, ypos, depth)
end