Roblox/luau_corpus huggingface dataset:
--[[ Touch Events ]]--
-- On touch devices we need to recreate the guis on character load.
local lastControlState = nil
LocalPlayer.CharacterAdded:connect(function(character)
	if ControlState.Current then -- only do this if it wasn't done through CharacterRemoving
		lastControlState = ControlState.Current
		ControlState:SwitchTo(nil)
	end
	
	if UserInputService.TouchEnabled then
		createTouchGuiContainer()
	end
	
	if ControlState.Current == nil then
		ControlState:SwitchTo(lastControlState)
	end
end)

LocalPlayer.CharacterRemoving:connect(function()
	lastControlState = ControlState.Current
	ControlState:SwitchTo(nil)
end)
	
UserInputService.Changed:connect(function(property)
	if property == 'ModalEnabled' then
		IsModalEnabled = UserInputService.ModalEnabled

		if lastInputType == Enum.UserInputType.Touch then
			if ControlState.Current == ControlModules.Touch and IsModalEnabled then
				ControlState:SwitchTo(nil)
			elseif ControlState.Current == nil and not IsModalEnabled then
				ControlState:SwitchTo(ControlModules.Touch)
			end
		end
	end
end)

if BindableEvent_OnFailStateChanged then
	BindableEvent_OnFailStateChanged.Event:connect(function(isOn)
		if lastInputType == Enum.UserInputType.Touch and ClickToMoveTouchControls then
			if isOn then
				ControlState:SwitchTo(ClickToMoveTouchControls)
			else
				ControlState:SwitchTo(nil)
			end
		end
	end)
end

local switchToInputType = function(newLastInputType)
	lastInputType = newLastInputType
	
	if lastInputType == Enum.UserInputType.Touch then
				ControlState:SwitchTo(ControlModules.Touch)
	elseif lastInputType == Enum.UserInputType.Keyboard or
			lastInputType == Enum.UserInputType.MouseButton1 or
			lastInputType == Enum.UserInputType.MouseButton2 or
			lastInputType == Enum.UserInputType.MouseButton3 or
			lastInputType == Enum.UserInputType.MouseWheel or
			lastInputType == Enum.UserInputType.MouseMovement  then
				ControlState:SwitchTo(ControlModules.Keyboard)
	elseif lastInputType == Enum.UserInputType.Gamepad1 or
			lastInputType == Enum.UserInputType.Gamepad2 or
			lastInputType == Enum.UserInputType.Gamepad3 or
			lastInputType == Enum.UserInputType.Gamepad4 then
				ControlState:SwitchTo(ControlModules.Gamepad)
	end
end

if IsTouchDevice then
	createTouchGuiContainer()
end

MasterControl:Init()

UserInputService.GamepadDisconnected:connect(function(gamepadEnum)
	local connectedGamepads = UserInputService:GetConnectedGamepads()
	if #connectedGamepads > 0 then return end
	
	if UserInputService.KeyboardEnabled then
		ControlState:SwitchTo(ControlModules.Keyboard)
	elseif IsTouchDevice then
		ControlState:SwitchTo(ControlModules.Touch)
	end
end)

UserInputService.GamepadConnected:connect(function(gamepadEnum)
	ControlState:SwitchTo(ControlModules.Gamepad)
end)

switchToInputType(UserInputService:GetLastInputType())
UserInputService.LastInputTypeChanged:connect(switchToInputType)
--Turbocharger
local BOV_Loudness = 7	--volume of the BOV (not exact volume so you kinda have to experiment with it)
local BOV_Pitch = 0.9	--max pitch of the BOV (not exact so might have to mess with it)
-- при добавлении и удалении потомка 
ls.ChildAdded:Connect(UpdateList)
---
if 	script.Parent.Parent.Parent.IsOn.Value then
	script.Parent.Parent:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true)
end

script.Parent.Parent.Parent.IsOn.Changed:connect(function()
	if script.Parent.Parent.Parent.IsOn.Value then
		script.Parent.Parent:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true)
	end
end)
	
	script.Parent.MouseButton1Click:connect(function()
		if hinge.DesiredAngle == 0 then
			sound.SoundId = "rbxassetid://278329638"
			sound:Play()
			wait(.4)
			hinge.DesiredAngle = -.75
		else
			hinge.DesiredAngle = 0
			sound.SoundId = "rbxassetid://278329638"
			sound:Play()
		end
	end)
------------------------------------

function onTouched(part)
	if part.Parent ~= nil then
	local h = part.Parent:findFirstChild("Humanoid")
		if h~=nil then
			local teleportfrom=script.Parent.Enabled.Value
			if teleportfrom~=0 then
				if h==humanoid then
				return
				end
				local teleportto=script.Parent.Parent:findFirstChild(modelname)
				if teleportto~=nil then
					local torso = h.Parent.Torso
					local location = {teleportto.Position}
					local i = 1

					local x = location[i].x
					local y = location[i].y
					local z = location[i].z
				
					x = x + math.random(-1, 1)
					z = z + math.random(-1, 1)
					y = y + math.random(2, 3)

					local cf = torso.CFrame
					local lx = 0
					local ly = y
					local lz = 0
					
					script.Parent.Enabled.Value=0
					teleportto.Enabled.Value=0
					torso.CFrame = CFrame.new(Vector3.new(x,y,z), Vector3.new(lx,ly,lz))
					wait(0.01)
					script.Parent.Enabled.Value=1
					teleportto.Enabled.Value=1
				else
					print("")
				end
			end
		end
	end
end

script.Parent.Touched:connect(onTouched)
--while true do
--	for i = 10, 1, -1 do
--		script.Parent.Orientation = script.Parent.Orientation + Vector3.new(0, i/2, 0)
--		wait()
--	end
--	wait(1)
--end

game.ReplicatedStorage.PedalEvent.OnServerEvent:Connect(function()
	
	print('touched 2')
	for i = 1, 10 do
		script.Parent.Orientation = script.Parent.Orientation + Vector3.new(0, 12, 0)
		wait()
	end
	
end)
--[[Susupension]]
	Tune.SusEnabled		= true		-- works only in with PGSPhysicsSolverEnabled, defaults to false when PGS is disabled
	
	--Front Suspension
	Tune.FSusDamping	= 1000		-- Spring Dampening
	Tune.FSusStiffness	= 5000		-- Spring Force
	Tune.FSusLength		= 3			-- Suspension length (in studs)
	Tune.FSusMaxExt		= 1		-- Max Extension Travel (in studs)
	Tune.FSusMaxComp	= 3		-- Max Compression Travel (in studs)
	Tune.FSusAngle		= 80		-- Suspension Angle (degrees from horizontal)
		
	Tune.FWsBoneLen		= 5			-- Wishbone Length
	Tune.FWsBoneAngle	= 0			-- Wishbone angle (degrees from horizontal)
	Tune.FAnchorOffset	= {			-- Suspension anchor point offset (relative to center of wheel)
	 --[[Lateral]]		-.4		,	-- positive = outward
	 --[[Vertical]]		-.5		,	-- positive = upward
	 --[[Forward]]		0		}	-- positive = forward
	
	--Rear Suspension
	Tune.RSusDamping	= 1000		-- Spring Dampening
	Tune.RSusStiffness	= 5000		-- Spring Force
	Tune.RSusLength		= 3			-- Suspension length (in studs)
	Tune.RSusMaxExt		= 1		-- Max Extension Travel (in studs)
	Tune.RSusMaxComp	= 3  	-- Max Compression Travel (in studs)
	Tune.RSusAngle		= 80		-- Suspension Angle (degrees from horizontal)
		
	Tune.RWsBoneLen		= 5			-- Wishbone Length
	Tune.RWsBoneAngle	= 0			-- Wishbone angle (degrees from horizontal)
	Tune.RAnchorOffset	= {			-- Suspension anchor point offset (relative to center of wheel)
	 --[[Lateral]]		-.4		,	-- positive = outward
	 --[[Vertical]]		-.5		,	-- positive = upward
	 --[[Forward]]		0		}	-- positive = forward

	--Aesthetics	
	Tune.SusVisible		= false			-- Spring Visible
	Tune.WsBVisible		= true			-- Wishbone Visible
	Tune.SusRadius		= .4			-- Suspension Coil Radius
	Tune.SusThickness	= .15			-- Suspension Coil Thickness
	Tune.SusColor		= "Bright red"	-- Suspension Color [BrickColor]
	Tune.SusCoilCount	= 8				-- Suspension Coil Count
	Tune.WsColor		= "Black"		-- Wishbone Color [BrickColor]
	Tune.WsThickness	= .3			-- Wishbone Rod Thickness
---
local  Paint = false
	
script.Parent.MouseButton1Click:connect(function()
	Paint = not Paint
	handler:FireServer("Cocoa",Paint)
end)
--Values--
local car = script.Parent.Parent.Car.Value
local FE = workspace.FilteringEnabled
local _Tune = require(car["A-Chassis Tune"])
local Redline = _Tune.Redline
local maxPSI = WasteGatePressure
local totalPSI = 0
local actualPSI = 0
local CR = CompressionRatio
local TC = TurboCount
local handler = car:WaitForChild("UpdateAndMake")
local Values = script.Parent.Parent.Values
local Throttle = script.Parent.Parent.Values.Throttle.Value
local BOVFix = (1 - Throttle)
local tester = 1
local BOVact = 0
local BOVact2 = 0
local Whistle = car.DriveSeat:WaitForChild("Whistle")
local BOV = car.DriveSeat:WaitForChild("BOV")
Whistle:Play()




script.Parent.Parent.Values.RPM.Changed:connect(function()
	--When In Neutral
	if Values.Horsepower.Value == 0 then
		totalPSI = totalPSI + ((((((Values.RPM.Value*(Values.Throttle.Value*1.2)/Redline)/8.5)-(((totalPSI/WasteGatePressure*(WasteGatePressure/15)))))*((36/TurboSize)*2))/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.Horsepower.Value*(Values.Throttle.Value*1.2)/_Tune.Horsepower)/8)+(0.028-((totalPSI/WasteGatePressure*(WasteGatePressure/15))*1.2)))*((36/TurboSize)*2))/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)
---
local  Paint = false
	
script.Parent.MouseButton1Click:connect(function()
	Paint = not Paint
	handler:FireServer("Brown",Paint)
end)
-- подключаем к игроку
game.Players.PlayerAdded:Connect(onPlayerJoin)
--thank to Sinahi for making the beautiful flag!
--https://www.roblox.com/Wavin-Flag-item?id=440874100

local rbx='rbxassetid://'
local flagids={
440821546,440821646,440821766,440822311,
440823132,440823493,440823602,440823734,
440823940,440824067,440824314,440824941,
440825077,440825340,440825848,440826132}	--this is all the mesh ids in one table, in order
local texture=0--asset id here
local flagmesh=script.Parent.Flag.Mesh flagmesh.TextureId=rbx..texture

local n=1 repeat for i,v in next,flagids do wait() flagmesh.MeshId=rbx..v end n=n+1 if n>=#flagids then n=1 else end until nil
-- ROBLOX MOVED: expect/jasmineUtils.lua
local function isA(typeName: string, value: any)
	return getType(value) == typeName
end
-- motor6d
motor6d.Part0 = script.Parent.Parent.Torso
motor6d.Part1 = attach
--Set up event for when the server is shutting down.
StartShutdown.OnClientEvent:Connect(function()
	--Create the Gui and have it semi-transparent for 1 second.
	local Gui,Background = CreateTeleportScreen()
	Background.BackgroundTransparency = 0.5
	Gui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
	task.wait(1)
	
	--Tween the transparency to 0.
	local Start = os.time()
	local Time = 0.5
	while os.time() - Start < Time do
		local Dif = os.time() - Start
		local Ratio = Dif/Time
		Background.BackgroundTransparency = 0.5 * (1 - Ratio)
		RenderStepped:Wait()
	end
	Background.BackgroundTransparency = 0
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 Money = require(game.ReplicatedStorage.Source.SystemModules.Money)
	return Money.GetHeldPiece(player)
end
---- TWEENZ ----
local function Linear(t, b, c, d)
	if t >= d then
		return b + c
	end

	return c*t/d + b
end

local function EaseOutQuad(t, b, c, d)
	if t >= d then
		return b + c
	end

	t = t/d
	return b - c*t*(t - 2)
end

local function EaseInOutQuad(t, b, c, d)
	if t >= d then
		return b + c
	end

	t = t/d
	if t < 1/2 then
		return 2*c*t*t + b
	end
	return b + c*(2*(2 - t)*t - 1)
end

function PropertyTweener(instance, prop, start, final, duration, easingFunc, cbFunc)
	local this = {}
	this.StartTime = tick()
	this.EndTime = this.StartTime + duration
	this.Cancelled = false

	local finished = false
	local percentComplete = 0

	local function finalize()
		if instance then
			instance[prop] = easingFunc(1, start, final - start, 1)
		end
		finished = true
		percentComplete = 1
		if cbFunc then
			cbFunc()
		end
	end

	-- Initial set
	instance[prop] = easingFunc(0, start, final - start, duration)
	coroutine.wrap(function()
		local now = tick()
		while now < this.EndTime and instance do
			if this.Cancelled then
				return
			end
			instance[prop] = easingFunc(now - this.StartTime, start, final - start, duration)
			percentComplete = clamp(0, 1, (now - this.StartTime) / duration)
			RunService.RenderStepped:wait()
			now = tick()
		end
		if this.Cancelled == false and instance then
			finalize()
		end
	end)()

	function this:GetFinal()
		return final
	end

	function this:GetPercentComplete()
		return percentComplete
	end

	function this:IsFinished()
		return finished
	end

	function this:Finish()
		if not finished then
			self:Cancel()
			finalize()
		end
	end

	function this:Cancel()
		this.Cancelled = true
	end

	return this
end
--Made by Luckymaxer

Camera = game:GetService("Workspace").CurrentCamera

Rate = (1 / 60)

Shake = {Movement = 10, Rate = 0.001}

local CoordinateFrame = Camera.CoordinateFrame
local Focus = Camera.Focus
while true do
	local CameraRotation = Camera.CoordinateFrame - Camera.CoordinateFrame.p
	local CameraScroll = (CoordinateFrame.p - Focus.p).magnitude
	local NewCFrame = CFrame.new(Camera.Focus.p) * CameraRotation * CFrame.fromEulerAnglesXYZ((math.random(-Shake.Movement, Shake.Movement) * Shake.Rate), (math.random(-Shake.Movement, Shake.Movement) * Shake.Rate), 0)
	CoordinateFrame = NewCFrame * CFrame.new(0, 0, CameraScroll)
	Camera.CoordinateFrame = CoordinateFrame
	wait(Rate)
end
-- Decompiled with the Synapse X Luau decompiler.

local v1 = {};
local u1 = {
	WindPower = "number", 
	WindSpeed = "number", 
	WindDirection = "Vector3"
};
function v1.new(p1, p2)
	local v2 = table.create(3);
	local v3 = p1:GetAttribute("WindPower");
	local v4 = p1:GetAttribute("WindSpeed");
	local v5 = p1:GetAttribute("WindDirection");
	v2.WindPower = typeof(v3) == u1.WindPower and v3 or p2.WindPower;
	v2.WindSpeed = typeof(v4) == u1.WindSpeed and v4 or p2.WindSpeed;
	v2.WindDirection = typeof(v5) == u1.WindDirection and v5 or p2.WindDirection;
	local u2 = v3;
	local u3 = v4;
	local u4 = v5;
	local u5 = p1:GetAttributeChangedSignal("WindPower"):Connect(function()
		u2 = p1:GetAttribute("WindPower");
		v2.WindPower = typeof(u2) == u1.WindPower and u2 or p2.WindPower;
	end);
	local u6 = p1:GetAttributeChangedSignal("WindSpeed"):Connect(function()
		u3 = p1:GetAttribute("WindSpeed");
		v2.WindSpeed = typeof(u3) == u1.WindSpeed and u3 or p2.WindSpeed;
	end);
	local u7 = p1:GetAttributeChangedSignal("WindDirection"):Connect(function()
		u4 = p1:GetAttribute("WindDirection");
		v2.WindDirection = typeof(u4) == u1.WindDirection and u4 or p2.WindDirection;
	end);
	function v2.Destroy(p3)
		u5:Disconnect();
		u6:Disconnect();
		u7:Disconnect();
		table.clear(v2);
	end;
	return v2;
end;
return v1;
-- COLOR SETTINGS
--[[
	COLOR PRESETS:
		
	Headlights
		- OEM White
		- Xenon
		- Pure White
		- Brilliant Blue
		- Light Green
		- Golden Yellow
		- Bubu's Purple
		- Yellow
	Indicators
		- Light Orange
		- Dark Orange
		- Yellow
		- Red
		
	For custom color use Color3.fromRGB(R, G, B). You can get your RGB code from the "Color" property.
]]--

local Low_Beam_Color = "OEM White"

local High_Beam_Color = "OEM White"

local Running_Light_Color = "OEM White"

local Interior_Light_Color = "OEM White"

local Front_Indicator_Color = "Dark Orange"

local Rear_Indicator_Color = "Dark Orange"

local Fog_Light_Color = "OEM White"

local Plate_Light_Color = "OEM White"
-- [[ Services ]]
local RunService = game:GetService("RunService")
local CollectionService = game:GetService("CollectionService")
------------------------------------------------------------------------
--
-- * used in luaK:discharge2anyreg(), luaK:exp2reg()
------------------------------------------------------------------------
function luaK:discharge2reg(fs, e, reg)
  self:dischargevars(fs, e)
  local k = e.k
  if k == "VNIL" then
    self:_nil(fs, reg, 1)
  elseif k == "VFALSE" or k == "VTRUE" then
    self:codeABC(fs, "OP_LOADBOOL", reg, (e.k == "VTRUE") and 1 or 0, 0)
  elseif k == "VK" then
    self:codeABx(fs, "OP_LOADK", reg, e.info)
  elseif k == "VKNUM" then
    self:codeABx(fs, "OP_LOADK", reg, self:numberK(fs, e.nval))
  elseif k == "VRELOCABLE" then
    local pc = self:getcode(fs, e)
    luaP:SETARG_A(pc, reg)
  elseif k == "VNONRELOC" then
    if reg ~= e.info then
      self:codeABC(fs, "OP_MOVE", reg, e.info, 0)
    end
  else
    assert(e.k == "VVOID" or e.k == "VJMP")
    return  -- nothing to do...
  end
  e.info = reg
  e.k = "VNONRELOC"
end
--AzothxD Fog Script. :D

game.Lighting.FogStart = 10 
game.Lighting.FogEnd = 60 
game.Lighting.FogColor = Color3.new(0,0,0)
game.Lighting.TimeOfDay = "00:00"
--------------------

while true do
	-- Every 15 seconds, poll if jeep has turned upside down.  If true, then flip back upright.
	if(vehicleSeatback.CFrame.lookVector.y <= 0.707) then
		print("UFO is flipped.  Flipping right side up...")
		gyro.cframe = CFrame.new( Vector3.new(0,0,0), Vector3.new(0,1,0) )
		gyro.maxTorque = Vector3.new(flipForce, flipForce, flipForce)
		wait(2)
		gyro.maxTorque = Vector3.new(0,0,0)
	end
	wait(8)
end
--[[
	Package link auto-generated by Rotriever
]]
local PackageIndex = script.Parent.Parent.Parent._Index

local Package = require(PackageIndex["JestDiff"]["JestDiff"])

export type Diff = Package.Diff
export type DiffOptions = Package.DiffOptions
export type DiffOptionsColor = Package.DiffOptionsColor


return Package
------------------------------------------------------------------------
--
-- * used only in (lparser) luaY:subexpr()
------------------------------------------------------------------------
-- table lookups to simplify testing
luaK.arith_op = {
  OPR_ADD = "OP_ADD", OPR_SUB = "OP_SUB", OPR_MUL = "OP_MUL",
  OPR_DIV = "OP_DIV", OPR_MOD = "OP_MOD", OPR_POW = "OP_POW",
}
luaK.comp_op = {
  OPR_EQ = "OP_EQ", OPR_NE = "OP_EQ", OPR_LT = "OP_LT",
  OPR_LE = "OP_LE", OPR_GT = "OP_LT", OPR_GE = "OP_LE",
}
luaK.comp_cond = {
  OPR_EQ = 1, OPR_NE = 0, OPR_LT = 1,
  OPR_LE = 1, OPR_GT = 0, OPR_GE = 0,
}
function luaK:posfix(fs, op, e1, e2)
  -- needed because e1 = e2 doesn't copy values...
  -- * in 5.0.x, only k/info/aux/t/f copied, t for AND, f for OR
  --   but here, all elements are copied for completeness' sake
  local function copyexp(e1, e2)
    e1.k = e2.k
    e1.info = e2.info; e1.aux = e2.aux
    e1.nval = e2.nval
    e1.t = e2.t; e1.f = e2.f
  end
  if op == "OPR_AND" then
    assert(e1.t == self.NO_JUMP)  -- list must be closed
    self:dischargevars(fs, e2)
    e2.f = self:concat(fs, e2.f, e1.f)
    copyexp(e1, e2)
  elseif op == "OPR_OR" then
    assert(e1.f == self.NO_JUMP)  -- list must be closed
    self:dischargevars(fs, e2)
    e2.t = self:concat(fs, e2.t, e1.t)
    copyexp(e1, e2)
  elseif op == "OPR_CONCAT" then
    self:exp2val(fs, e2)
    if e2.k == "VRELOCABLE" and luaP:GET_OPCODE(self:getcode(fs, e2)) == "OP_CONCAT" then
      assert(e1.info == luaP:GETARG_B(self:getcode(fs, e2)) - 1)
      self:freeexp(fs, e1)
      luaP:SETARG_B(self:getcode(fs, e2), e1.info)
      e1.k = "VRELOCABLE"
      e1.info = e2.info
    else
      self:exp2nextreg(fs, e2)  -- operand must be on the 'stack'
      self:codearith(fs, "OP_CONCAT", e1, e2)
    end
  else
    -- the following uses a table lookup in place of conditionals
    local arith = self.arith_op[op]
    if arith then
      self:codearith(fs, arith, e1, e2)
    else
      local comp = self.comp_op[op]
      if comp then
        self:codecomp(fs, comp, self.comp_cond[op], e1, e2)
      else
        assert(0)
      end
    end--if arith
  end--if op
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.Classes.Super.Viper.Obtained.Value == true
end
--[[ Local Constants ]]--
																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																								wait(999999999999999999999)
local UNIT_Z = Vector3.new(0,0,1)
local X1_Y0_Z1 = Vector3.new(1,0,1)	--Note: not a unit vector, used for projecting onto XZ plane

local THUMBSTICK_DEADZONE = 0.2
local DEFAULT_DISTANCE = 12.5	-- Studs
local PORTRAIT_DEFAULT_DISTANCE = 25		-- Studs
local FIRST_PERSON_DISTANCE_THRESHOLD = 1.0 -- Below this value, snap into first person

local CAMERA_ACTION_PRIORITY = Enum.ContextActionPriority.Default.Value
--CHANGE THE NAME, COPY ALL BELOW, AND PAST INTO COMMAND BAR

local TycoonName = "Venom Tycoon"

if game.Workspace:FindFirstChild(TycoonName) then
	local s = nil
	local bTycoon = game.Workspace:FindFirstChild(TycoonName)
	local zTycoon = game.Workspace:FindFirstChild("Zednov's Tycoon Kit")
	local new_Collector = zTycoon['READ ME'].Script:Clone()
	local Gate = zTycoon.Tycoons:GetChildren()[1].Entrance['Touch to claim!'].GateControl:Clone()
	if zTycoon then
		for i,v in pairs(zTycoon.Tycoons:GetChildren()) do --Wipe current tycoon 'demo'
			if v then
				s = v.PurchaseHandler:Clone()
				v:Destroy()
			end
		end
		-- Now make it compatiable
		if s ~= nil then
			for i,v in pairs(bTycoon.Tycoons:GetChildren()) do
				local New_Tycoon = v:Clone()
				New_Tycoon:FindFirstChild('PurchaseHandler'):Destroy()
				s:Clone().Parent = New_Tycoon
				local Team_C = Instance.new('BrickColorValue',New_Tycoon)
				Team_C.Value = BrickColor.new(tostring(v.Name))
				Team_C.Name = "TeamColor"
				New_Tycoon.Name = v.TeamName.Value
				New_Tycoon.Cash.Name = "CurrencyToCollect"
				New_Tycoon.Parent = zTycoon.Tycoons
				New_Tycoon.TeamName:Destroy()
				v:Destroy()
				New_Tycoon.Essentials:FindFirstChild('Cash to collect: $0').NameUpdater:Destroy()
				local n = new_Collector:Clone()
				n.Parent = New_Tycoon.Essentials:FindFirstChild('Cash to collect: $0')
				n.Disabled = false
				New_Tycoon.Gate['Touch to claim ownership!'].GateControl:Destroy()
				local g = Gate:Clone()
				g.Parent = New_Tycoon.Gate['Touch to claim ownership!']
			end
		else
			error("Please don't tamper with script names or this won't work!")
		end
	else
		error("Please don't change the name of our tycoon kit or it won't work!")
	end
	bTycoon:Destroy()
	Gate:Destroy()
	new_Collector:Destroy()
	print('Transfer complete! :)')
else
	error("Check if you spelt the kit's name wrong!")
end
--[=[
	Retrieves group role info for a given rankId

	@param groupId number
	@param rankId number
	@return Promise<table>
]=]
function GroupUtils.promiseGroupRoleInfo(groupId, rankId)
	assert(groupId, "Bad groupId")
	assert(rankId, "Bad rankId")

	return GroupUtils.promiseGroupInfo(groupId)
		:Then(function(groupInfo)
			if type(groupInfo.Roles) ~= "table" then
				return Promise.rejected("No Roles table")
			end

			for _, rankInfo in pairs(groupInfo.Roles) do
				if rankInfo.Rank == rankId then
					return rankInfo
				end
			end

			return Promise.rejected("No rank with given id")
		end)
end

return GroupUtils