Roblox/luau_corpus huggingface dataset:
--[[ Utility Functions ]]--
local function IsFinite(num)
	return num == num and num ~= 1/0 and num ~= -1/0
end

local function IsFiniteVector3(vec3)
	return IsFinite(vec3.x) and IsFinite(vec3.y) and IsFinite(vec3.z)
end

local movementUpdateEvent = Instance.new("BindableEvent")
movementUpdateEvent.Name = "MovementUpdate"
movementUpdateEvent.Parent = script

coroutine.wrap(function()
	local PathDisplayModule = script.Parent:WaitForChild("PathDisplay")
	if PathDisplayModule then
		PathDisplay = require(PathDisplayModule)
	end
end)()
--Disable script if car is removed from workspace
Car.AncestryChanged:Connect(function()
	if not Car:IsDescendantOf(Workspace) then
		unbindActions()
		
		LocalVehicleSeating.ExitSeat()
		LocalVehicleSeating.DisconnectFromSeatExitEvent(onExitSeat)
		-- stop seated anim
		print("car removed from workspace")
		
		script.Disabled = true
	end
end)

local function getInputValue(keyInfo, inputObj)
	for _, keyCodeInfo in ipairs(keyInfo) do
		if inputObj.KeyCode == keyCodeInfo.KeyCode then
			if keyCodeInfo.Axis then
				local inputVector = inputObj.Position * keyCodeInfo.Axis
				local sign = math.sign(inputVector.X + inputVector.Y + inputVector.Z)
				return inputVector.magnitude * sign
			else
				return 1
			end
		end
	end
	return 0
end

local function exitVehicle(action, inputState, inputObj)
	if inputState == Enum.UserInputState.Begin then
		LocalVehicleSeating.ExitSeat()
		-- stop seated anim
	end
end

ContextActionService:BindAction(
	EXIT_ACTION_NAME,
	exitVehicle,
	false,
	Keymap.EnterVehicleGamepad,
	Keymap.EnterVehicleKeyboard
)

local function steerLeftAction(action, inputState, inputObj)
	if inputState == Enum.UserInputState.Begin or inputState == Enum.UserInputState.Change then
		SteerLeftValue = getInputValue(Keymap.SteerLeft, inputObj)
	else
		SteerLeftValue = 0
	end
	return Enum.ContextActionResult.Pass
end

ContextActionService:BindActionAtPriority(
	STEER_LEFT_ACTION_NAME,
	steerLeftAction,
	false,
	Enum.ContextActionPriority.High.Value,
	unpack(Keymap.KeysForAction("SteerLeft"))
)

local function steerRightAction(action, inputState, inputObj)
	if inputState == Enum.UserInputState.Begin or inputState == Enum.UserInputState.Change then
		SteerRightValue = getInputValue(Keymap.SteerRight, inputObj)
	else
		SteerRightValue = 0
	end
	return Enum.ContextActionResult.Pass
end

ContextActionService:BindActionAtPriority(
	STEER_RIGHT_ACTION_NAME,
	steerRightAction,
	false,
	Enum.ContextActionPriority.High.Value,
	unpack(Keymap.KeysForAction("SteerRight"))
)

local function throttleAction(action, inputState, inputObj)
	if inputState == Enum.UserInputState.Begin or inputState == Enum.UserInputState.Change then
		ThrottleValue = getInputValue(Keymap.Throttle, inputObj)
	else
		ThrottleValue = 0
	end
end

ContextActionService:BindAction(
	THROTTLE_ACTION_NAME,
	throttleAction,
	false,
	unpack(Keymap.KeysForAction("Throttle"))
)

local function brakeAction(action, inputState, inputObj)
	if inputState == Enum.UserInputState.Begin or inputState == Enum.UserInputState.Change then
		BrakeValue = getInputValue(Keymap.Brake, inputObj)
	else
		BrakeValue = 0
	end
end

ContextActionService:BindAction(
	BRAKE_ACTION_NAME,
	brakeAction,
	false,
	unpack(Keymap.KeysForAction("Brake"))
)

local function handBrakeAction(action, inputState, inputObj)
	if inputState == Enum.UserInputState.Begin then
		HandBrakeValue = 1
	else
		HandBrakeValue = 0
	end
end

ContextActionService:BindAction(
	HAND_BRAKE_ACTION_NAME,
	handBrakeAction,
	false,
	unpack(Keymap.KeysForAction("Handbrake"))
)
--// No-opt connect Server>Client RemoteEvents to ensure they cannot be called
--// to fill the remote event queue.
local function emptyFunction()
	--intentially empty
end

local function GetObjectWithNameAndType(parentObject, objectName, objectType)
	for _, child in pairs(parentObject:GetChildren()) do
		if (child:IsA(objectType) and child.Name == objectName) then
			return child
		end
	end

	return nil
end

local function CreateIfDoesntExist(parentObject, objectName, objectType)
	local obj = GetObjectWithNameAndType(parentObject, objectName, objectType)
	if (not obj) then
		obj = Instance.new(objectType)
		obj.Name = objectName
		obj.Parent = parentObject
	end
	useEvents[objectName] = obj

	return obj
end
--script.Parent.Parent.Values.RPM.Changed:connect(function()
function Spool()
	--When In Neutral
	if Values.Horsepower.Value == 0 then
		totalPSI = totalPSI + ((((((Values.RPM.Value*(Values.Throttle.Value*1.2)/Redline)/8)-(((totalPSI/WasteGatePressure*(WasteGatePressure/15)))))*((36/TurboSize)*3))/WasteGatePressure)*15)
		if totalPSI < 0.05 then
			totalPSI = 0.05
		end
		if totalPSI > 2 then
			totalPSI = 2
		end
		--TEST
		
	end
	--When Driving
	if Values.Horsepower.Value > 0 then
		totalPSI = totalPSI + ((((((Values.RPM.Value*(Values.Throttle.Value*1.2)/Redline)/8)-(((totalPSI/WasteGatePressure*(WasteGatePressure/15)))))*((36/TurboSize)*3))/WasteGatePressure)*15)
		if totalPSI < 0.05 then
			totalPSI = 0.05
		end
		if totalPSI > 2 then
			totalPSI = 2
		end
		--TEST
		
	end

	
	
	actualPSI = totalPSI/2
	

	if FE then
		local BP = totalPSI
		
		handler:FireServer(totalPSI,actualPSI,Throttle,BOVFix,BOV_Loudness,TurboLoudness,BOV_Pitch)
	else
		local Throttle2 = Throttle
		local W = car.DriveSeat:WaitForChild("Whistle")
		local B = car.DriveSeat:WaitForChild("BOV")

		local bvol = B.Volume		
		
		if Throttle2 < 0 then
			Throttle2 = 0
		end
		W.Pitch = (totalPSI)
		W.Volume = (totalPSI/4)*TurboLoudness
		B.Pitch = (1 - (-totalPSI/20))*BOV_Pitch
		B.Volume = (((-0.5+((totalPSI/2)*BOV_Loudness)))*(1 - script.Parent.Parent.Values.Throttle.Value))
		
	
		
	end
	end
-- Initialize the tool
local CollisionTool = {

	Name = 'Collision Tool';
	Color = BrickColor.new 'Really black';

};
--Offset For Each New Ray For The Bullet's Trajectory
local offset			= (parts.Parent.Gun.Muzzle.CFrame*CFrame.new(math.random(-4.3,4.3)/3,100,math.random(-4.3,4.3)/3).p
							- parts.Parent.Gun.Muzzle.Position).unit
							*script.Parent.Stats.GunVelocity.Value
local point1			= parts.Parent.Gun.Muzzle.Position
--Services
local debrisService = game:GetService("Debris")
local runService = game:GetService("RunService")
local tweenService = game:GetService("TweenService")
--Set up returned table
local Input = {}
	Input.Triggers = 0 --Triggers
	Input.LStickX = 0 --L/R on left stick
	Input.LStickY = 0	--F/B on left stick	
	Input.Forward = 0 --W/S or Up/Down
	Input.Strafe = 0 --A/D or Left/Right
	Input.Shift = 0 --LShift/LControl
	--Input.Flip = 0 --C key / Y button
	--TODO: Include inputs for Entering Car (E) and redress (C)
	Input.InputMode = "Keyboard"
	Input.TypeChanged = script.TypeChanged.Event --Allow the vehicle to know when the input changed
	Input.ActionFired = script.ActionFired.Event --Allow vehicle to know when special key is fired
--[[
Welds two parts.
--]]
local function WeldBetween(Part1,Part2)
	local Weld = Instance.new("Weld")
	Weld.Part0 = Part1
	Weld.Part1 = Part2
	Weld.C0 = Part1.CFrame:inverse()
	Weld.C1 = Part2.CFrame:inverse()
	Weld.Parent = Part1
end
-------------------------
while true do
Puerta1.BodyVelocity.velocity = Vector3.new(0, 0, 0.5)
Puerta2.BodyVelocity.velocity = Vector3.new(0, 0, -0.5)
wait(8)
Puerta1.BodyVelocity.velocity = Vector3.new(0, 0, 0)
Puerta2.BodyVelocity.velocity = Vector3.new(0, 0, 0)
break
end
--I advise to keep true if this tool has a "FlyScript" created after 20/7/2011 ( see child of this script)
local Vert_keep = true-- set to false if U DONT want the tool to Go only Up if u press/hold the U/J key
-- Variables

if script.Parent.Damage.Value < 1 then

local Vehicle = script.Parent
print("Vehicle Destroy Script Enabled")

local Engine = Vehicle.Parts.Engine

Vehicle:findFirstChild("Destroyed").Value = true

			
	-- Seat Variables
	Vehicle.Parts:findFirstChild("VehicleSeat").Disabled = true
	
	-- End of Seat Variables
-- LocalScript

local numValue = Player.CoinBoost -- substitua "NumValue" pelo nome da sua NumberValue
local textLabel = script.Parent -- substitua "TextLabel" pelo nome do seu TextLabel
-- A state object whose value is derived from other objects using a callback.
export type Computed<T> = StateObject<T> & Dependent & {
	-- kind: "Computed" (add this when Luau supports singleton types)
}
--This script will go into the humanoid, and slowly make the Health go to 0.

Length = 150
Lethality = 0.5
WaitTime = 0
--
--
Monster:Initialize()
Monster:InitializeUnique()

game:GetService("RunService").Heartbeat:Connect(function()
	if not Monster:IsAlive() then
		if Data.IsDead == false then
			Data.IsDead = true
			Data.TimeOfDeath = tick()
			Self.Died:Fire()
		end
		if Data.IsDead == true then
			if tick()-Data.TimeOfDeath > Info.RespawnWaitTime then
				Monster:Respawn()
			end
		end
	end
	
	if Monster:IsAlive() then
		Monster:Update()
	end
end)
-- Whopper whopper whopper whopper junior double triple whopper flame-grilled taste with perfect toppers i rule this day lettuce mayo pickle ketchup its okay if i dont want that impossible with bacon whopper my way

wait(1);
local u1 = game:GetService("Players").LocalPlayer.Character.Humanoid:LoadAnimation((script:FindFirstChild("Animation")));
script.Parent.Equipped:Connect(function()
	for i = 1,10 do
		script.Parent.Handle.SpotLight.Brightness = script.Parent.Handle.SpotLight.Brightness - 1
		wait(2.5)
	end
end)
script.Parent.Equipped:Connect(function()
	script.Parent.Handle["Light Bulb Buzz 2 (SFX)"].Playing = true
end)
script.Parent.Unequipped:Connect(function()
	script.Parent.Handle["Light Bulb Buzz 2 (SFX)"].Playing = false
end)
script.Parent.Activated:Connect(function()
	u1:play();
	script.Parent.Handle.Sound:Play()
	script.Parent.Handle.SpotLight.Brightness += 1
	if script.Parent.Handle.SpotLight.Brightness >= 10 then
		script.Parent.Handle.SpotLight.Brightness = 10
	end
end);
--Setup animation here--
setup(animation.SL1,0.001)
setup(animation.SL2,0.001)
setup(animation.SL3,0.001)
setup(animation.SL4,0.001)
setup(animation.F1,0.001)
setup(animation.F2,0.001)
setup(animation.F3,0.001)
setup(animation.F4,0.001)
setup(animation.FF1,0.001)
setup(animation.FF2,0.001)
setup(animation.FF3,0.001)
setup(animation.FF4,0.001)
setup(animation.S1,0.01)
setup(animation.S2,0.01)
setup(animation.S3,0.01)
setup(animation.S4,0.01)
setup(animation.FLDoor,0.01)
setup(animation.FRDoor,0.01)
setup(animation.RLDoor,0.01)
setup(animation.RRDoor,0.01)
setup(animation.CDoor1,0.01)
setup(animation.CDoor2,0.01)
setup(animation.Engine1)
setup(animation.Engine2)
setup(animation.NGear,0.008)
setup(animation.LGear,0.005)
setup(animation.RGear,0.005)
setup(animation.NGDoorL,0.013)
setup(animation.NGDoorR,0.013)
setup(animation.LGDoor,0.005)
setup(animation.RGDoor,0.005)
setupInside(animation.F1.T,0.001)
setupInside(animation.F2.T,0.001)
setupInside(animation.F3.T,0.001)
setupInside(animation.F4.T,0.001)
setupInside(animation.LGDoor.Door)
setupInside(animation.LGDoor.Door.Door,0.005)
setupInside(animation.RGDoor.Door)
setupInside(animation.RGDoor.Door.Door,0.005)
setupInside(animation.LGear.Gear,0.005)
setupInside(animation.RGear.Gear,0.005)
setupInside(animation.LGear.Gear.Strut,0.025)
setupInside(animation.RGear.Gear.Strut,0.025)
setupInside(animation.NGear.Wheel)
setupInside(animation.LGear.Gear.Wheel)
setupInside(animation.RGear.Gear.Wheel)
setup(animation.RThrust)
wait(2)
animation.NGDoorL.A.Motor.DesiredAngle = 1.35
animation.NGDoorR.A.Motor.DesiredAngle = 1.35
animation.LGDoor.A.Motor.DesiredAngle = 1.5
animation.RGDoor.A.Motor.DesiredAngle = 1.5
animation.LGDoor.Door.Door.A.Motor.DesiredAngle = 1
animation.RGDoor.Door.Door.A.Motor.DesiredAngle = 1
animation.Engine1.A.Motor.DesiredAngle = 100e100
animation.Engine2.A.Motor.DesiredAngle = 100e100
animation.NGear.Wheel.A.Motor.C1 = animation.NGear.Wheel.A.Motor.C1 * CFrame.new(0,-0.6,0)
animation.LGear.Gear.Wheel.A.Motor.C1 = animation.LGear.Gear.Wheel.A.Motor.C1 * CFrame.new(0,-0.6,0)
animation.RGear.Gear.Wheel.A.Motor.C1 = animation.RGear.Gear.Wheel.A.Motor.C1 * CFrame.new(0,-0.6,0)
animation.LGDoor.Door.A.Motor.C1 = animation.LGDoor.Door.A.Motor.C1 * CFrame.new(-1.45,0,0)
animation.RGDoor.Door.A.Motor.C1 = animation.RGDoor.Door.A.Motor.C1 * CFrame.new(-1.45,0,0)
script.Parent.Weld.Disabled = false
unAnchor(script.Parent.AnimationParts)
--///////////////// Internal-Use Methods
--//////////////////////////////////////
function methods:InternalDestroy()
	for i, channel in pairs(self.Channels) do
		channel:InternalRemoveSpeaker(self)
	end

	self.eDestroyed:Fire()

	self.EventFolder = nil
	self.eDestroyed:Destroy()
	self.eSaidMessage:Destroy()
	self.eReceivedMessage:Destroy()
	self.eReceivedUnfilteredMessage:Destroy()
	self.eMessageDoneFiltering:Destroy()
	self.eReceivedSystemMessage:Destroy()
	self.eChannelJoined:Destroy()
	self.eChannelLeft:Destroy()
	self.eMuted:Destroy()
	self.eUnmuted:Destroy()
	self.eExtraDataUpdated:Destroy()
	self.eMainChannelSet:Destroy()
	self.eChannelNameColorUpdated:Destroy()
end

function methods:InternalAssignPlayerObject(playerObj)
	self.PlayerObj = playerObj
end

function methods:InternalAssignEventFolder(eventFolder)
	self.EventFolder = eventFolder
end

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

function methods:InternalSendFilteredMessage(messageObj, channelName)
	local success, err = pcall(function()
		self:LazyFire("eReceivedMessage", messageObj, channelName)
		self:LazyFire("eMessageDoneFiltering", messageObj, channelName)
		if self.PlayerObj then
			self.EventFolder.OnMessageDoneFiltering:FireClient(self.PlayerObj, messageObj, channelName)
		end
	end)
	if not success and err then
		print("Error sending internal filtered message: " ..err)
	end
end
--Made by Luckymaxer

Part = script.Parent

Duration = Part:WaitForChild("Duration")

wait(Duration.Value)

if Part:IsA("Part") then
	for i, v in pairs(Part:GetChildren()) do
		if v:IsA("ParticleEmitter") then
			v.Enabled = false
		end
	end
elseif Part:IsA("ParticleEmitter") then
	Part.Enabled = false
end
--// # key, Yelp
mouse.KeyDown:connect(function(key)
	if key=="t" then 
		if veh.Lightbar.middle.Yelp.IsPlaying == true then
		veh.Lightbar.middle.Beep:Play()
		veh.Lightbar.middle.Yelp:Stop()
		script.Parent.Parent.Sirens.Yelp.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
		else
		veh.Lightbar.middle.Beep:Play()
		veh.Lightbar.middle.Yelp:Play()
		veh.Lightbar.middle.Priority:Stop()
		script.Parent.Parent.Sirens.Yelp.BackgroundColor3 = Color3.fromRGB(215, 135, 110)
		script.Parent.Parent.Sirens.Wail.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
		script.Parent.Parent.Sirens.Priority.BackgroundColor3 = Color3.fromRGB(62, 62, 62)
		end
	end
end)
-- Waits for the child of the specified parent
local function WaitForChild(parent, childName)
	while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
	return parent[childName]
end


local Tool = script.Parent
local Handle = WaitForChild(Tool, 'Handle')
local Debounce = false

local TouchConnection


function OnTouched(hit)
	local humanoid = hit.Parent:findFirstChild('Humanoid')
	if Debounce == false then
		Debounce = true
		if humanoid then
			Handle.DeadPlayer:Play()
		else
		end
	end
	wait(0.5)
	Debounce = false
end


Tool.Equipped:connect(function()
	TouchConnection = Handle.Touched:connect(OnTouched)
end)

Tool.Unequipped:connect(function()
	if TouchConnection then
		TouchConnection:disconnect()
		TouchConnection = nil
	end
end)
-- events

EVENTS.Gun.Event:connect(function(action, ...)
	if action == "Enable" then
		currentSize, currentAmmo	= ...
		
		Update()
		GUN_GUI.Visible	= true
		
		if ammoConnection then
			ammoConnection:Disconnect()
			ammoConnection	= nil
		end
		
		if character then
			ammoConnection	= ammo[currentSize].Changed:connect(function()
				Update()
			end)
		end
	elseif action == "Disable" then
		GUN_GUI.Visible	= false
	elseif action == "Update" then
		currentAmmo	= ...
		Update()
	end
end)

PLAYER.CharacterAdded:connect(HandleCharacter)
--	if not debounce then	
--		debounce=true
		
		if target == bullet.Owner.Value then -- свой игрок
	--		print("мимо игрока")
			return -- не атакуем
		end
--[[
	Adds a new context entry to this component's context table (which will be
	passed down to child components).
]]
function Component:__addContext(key, value)
	if config.internalTypeChecks then
		internalAssert(Type.of(self) == Type.StatefulComponentInstance, "Invalid use of `__addContext`")
	end
	local virtualNode = self[InternalData].virtualNode

	-- Make sure we store a reference to the component's original, unmodified
	-- context the virtual node. In the reconciler, we'll restore the original
	-- context if we need to replace the node (this happens when a node gets
	-- re-rendered as a different component)
	if virtualNode.originalContext == nil then
		virtualNode.originalContext = virtualNode.context
	end

	-- Build a new context table on top of the existing one, then apply it to
	-- our virtualNode
	local existing = virtualNode.context
	virtualNode.context = assign({}, existing, { [key] = value })
end
-- limit how often the client can fire
local function onServerEvent(player, action, ...)
	if action == "wear" then
		wear(player, ...)
	elseif action == "skintone" then
		skinTone(player, ...)
	elseif action == "scale" then
		scale(player, ...)
	end
end
--[[
	Internal method used by setState (to trigger updates based on state) and by
	the reconciler (to trigger updates based on props)

	Returns true if the update was completed, false if it was cancelled by shouldUpdate
]]
function Component:__update(updatedElement, updatedState)
	if config.internalTypeChecks then
		internalAssert(Type.of(self) == Type.StatefulComponentInstance, "Invalid use of `__update`")
		internalAssert(
			Type.of(updatedElement) == Type.Element or updatedElement == nil,
			"Expected arg #1 to be of type Element or nil"
		)
		internalAssert(
			typeof(updatedState) == "table" or updatedState == nil,
			"Expected arg #2 to be of type table or nil"
		)
	end

	local internalData = self[InternalData]
	local componentClass = internalData.componentClass

	local newProps = self.props
	if updatedElement ~= nil then
		newProps = updatedElement.props

		if componentClass.defaultProps ~= nil then
			newProps = assign({}, componentClass.defaultProps, newProps)
		end

		self:__validateProps(newProps)
	end

	local updateCount = 0
	repeat
		local finalState
		local pendingState = nil

		-- Consume any pending state we might have
		if internalData.pendingState ~= nil then
			pendingState = internalData.pendingState
			internalData.pendingState = nil
		end

		-- Consume a standard update to state or props
		if updatedState ~= nil or newProps ~= self.props then
			if pendingState == nil then
				finalState = updatedState or self.state
			else
				finalState = assign(pendingState, updatedState)
			end

			local derivedState = self:__getDerivedState(newProps, finalState)

			if derivedState ~= nil then
				finalState = assign({}, finalState, derivedState)
			end

			updatedState = nil
		else
			finalState = pendingState
		end

		if not self:__resolveUpdate(newProps, finalState) then
			-- If the update was short-circuited, bubble the result up to the caller
			return false
		end

		updateCount = updateCount + 1

		if updateCount > MAX_PENDING_UPDATES then
			error(tooManyUpdatesMessage:format(tostring(internalData.componentClass)), 3)
		end
	until internalData.pendingState == nil

	return true
end
--print(name .. " [" .. idx .. "] " .. anim.id .. " (" .. anim.weight .. ")")
end
end
end
--------
--Main--
--------

for i,v in next, Gui.Frame:GetChildren() do
	v.Visible = false
end

local OSize = Gui.Frame.Size
local OPos = Gui.Frame.Position
Gui.Frame.Position = Gui.Frame.Position + UDim2.new(0, Gui.Frame.AbsoluteSize.X/2, 0, Gui.Frame.AbsoluteSize.Y/2)
Gui.Frame.Size = UDim2.new(0,0,0,0)

Gui.Frame.Visible = true
Gui.Frame:TweenSizeAndPosition(OSize,OPos)
wait(1)

for i,v in next, Gui.Frame:GetChildren() do
	v.Visible = true
end

Gui.Frame.Close.MouseButton1Click:connect(function ()
	for i,v in next, Gui.Frame:GetChildren() do
		v.Visible = false
	end
	Gui.Frame:TweenSizeAndPosition(UDim2.new(0,0,0,0),Gui.Frame.Position + UDim2.new(0, Gui.Frame.AbsoluteSize.X/2, 0, Gui.Frame.AbsoluteSize.Y/2))
	wait(1)
	Gui:Destroy()
end)
-- helpers
local Src = script.Parent
local ErrorReporter = require(Src.ErrorReporter)
local ErrorObserverClient = Src.ErrorObserverClient


local er = ErrorReporter.new()
local function onError(message, stack, origin)
	er:Report(message, stack, origin)
end
-- Services
local replicatedStorage = game:GetService("ReplicatedStorage")
local players = game:GetService("Players")
-- functions for calculating data for text from spritesheets

local function getStringWidth(text, sizeSet)
	local length, ntext = 0, #text;
	for i = 1, ntext do
		local i2 = i + 1 <= #text and i + 1;
		local b = byte(sub(text, i, i));
		local b2 = i2 and byte(sub(text, i2, i2));
		local character = sizeSet.characters[b];
		local kernx = 0
		if (b2 and sizeSet.kerning[b] and sizeSet.kerning[b][b2]) then
			kernx = sizeSet.kerning[b][b2].x;
		end;
		length = length + sizeSet.characters[b].xadvance + kernx;
	end;
	return length;
end;

local function getMaxHeight(text, sizeSet)
	local mheight, ntext = 0, #text;
	for i = 1, ntext do
		local b = byte(sub(text, i, i));
		local character = sizeSet.characters[b];
		local height = sizeSet.characters[b].height + sizeSet.characters[b].yoffset;
		if (height > mheight) then
			mheight = height;
		end;
	end;
	return mheight;
end;
--// Firemode Settings
	CanSelectFire = true;
	BurstEnabled = false;
	SemiEnabled = true;
	AutoEnabled = true;
	BoltAction = false;
	ExplosiveEnabled = false;
--[[local EffectFunctions = 
{
	function(hum,dir) hum:TakeDamage(1) end,
	function(hum,dir) hum:TakeDamage(-1) end,
	function(hum,dir) 
		if hum.Torso then
			local nforce = Instance.new('BodyForce')
			nforce.force = dir*3000
			nforce.Parent = hum.Torso
			hum.Sit = true
			game.Debris:AddItem(nforce,.2)
			Delay(.2,function() hum.Sit = false end)
		end
	end
}]]
Tool.Equipped:connect(function(mouse)
	--game.Players.LocalPlayer:GetMouse()
	Spawn(function()
		--local colorChoice = 1
		if not Tool.Parent:FindFirstChild('Torso') or not Tool.Parent.Torso:FindFirstChild('Right Shoulder') or not Tool.Parent:FindFirstChild('Humanoid') then return end
		--LazerSound:Play()
		nweld = Tool.Parent.Torso['Right Shoulder']
		oldC0 = nweld.C0
		nweld.CurrentAngle = 0
		nweld.DesiredAngle = 0
		nweld.MaxVelocity = 0
		--[[mouse.Button1Down:connect(function()
			colorChoice=colorChoice+1
			if colorChoice>#ColorChoices then colorChoice =1 end
			LazerSound.Pitch = .75+((colorChoice*.25)*3)
		end)]]
		equipped = true
		while equipped and Tool.Parent:FindFirstChild('Torso') do
			local tframe = Tool.Parent.Torso.CFrame
			tframe = tframe + tframe:vectorToWorldSpace(Vector3.new(1, 0.5, 0))
			local taim = mouse.Hit.p -( tframe.p )
			nweld.C0 = (CFrame.new(Vector3.new(),tframe:vectorToObjectSpace(taim))*CFrame.Angles(0,math.pi/2,0))+Vector3.new( 1, 0.5, 0 )
			--rayparts = CastLightRay(Handle.CFrame.p+Handle.CFrame:vectorToWorldSpace(StartOffset[colorChoice]),mouse.Hit.p,ColorChoices[colorChoice], 5, .2,rayparts, EffectFunctions[colorChoice])
			--LazerSound.Volume = ((math.sin(tick()*3)+1)*.25)+.25
			wait()
		end
		nweld.C0 =oldC0
		--LazerSound:Stop()
	end)
end)

Tool.Unequipped:connect(function(mouse)
	equipped= false
	--LazerSound:Stop()
	for i=1,50,1 do
		--[[if rayparts[i] then
			rayparts[i]:Destroy()
			rayparts[i]=nil		
		end]]
	end
	if nweld then
		nweld.MaxVelocity =.15
		nweld.C0 =oldC0
	end
	
end)
-- LOCAL FUNCTIONS
local function checkTopbarEnabled()
	local success, bool = xpcall(function()
		return starterGui:GetCore("TopbarEnabled")
	end, function(err)
		--has not been registered yet, but default is that is enabled
		return true
	end)
	return (success and bool)
end

local function checkTopbarEnabledAccountingForMimic()
	local topbarEnabledAccountingForMimic = (checkTopbarEnabled() or not IconController.mimicCoreGui)
	return topbarEnabledAccountingForMimic
end