Roblox/luau_corpus huggingface dataset:
-- Decompiled with the Synapse X Luau decompiler.

local v1 = require(game.ReplicatedStorage:WaitForChild("Resources"));
while not v1.Loaded do
	game:GetService("RunService").Heartbeat:Wait();
end;
local u1 = {
	Eggs = {}, 
	Areas = {}
};
function SendNotification(p1, p2)
	table.insert(u1[p2], p1);
	local v2 = nil;
	if p2 == "Eggs" then
		v2 = "You can afford to buy the " .. v1.Directory.Eggs[p1].display_name .. "!";
	elseif p2 == "Areas" then
		v2 = "You can afford to unlock the " .. v1.Directory.Worlds[p1].display_name .. " area!";
	end;
	v1.Signal.Fire("Notification", v2, {
		color = Color3.fromRGB(0, 187, 255), 
		time = 4
	});
	v1.Network.Fire("Sent Progress Notification", p1, p2);
end;
function AttemptNotification(p3, p4)
	local v3 = v1.StatService.Get();
	if not v3 then
		return;
	end;
	if not v1.Functions.SearchArray(u1[p4], p3) then
		if not v1.Functions.SearchArray(v3.ProgressNotifications[p4], p3) then
			SendNotification(p3, p4);
		end;
	end;
end;
function CheckForNotifications()
	local v4 = v1.StatService.Get();
	if not v4 then
		return;
	end;

	for v5, v6 in ipairs((v1.WorldCmds.GetAllEggs())) do
		if v5 then

		else
			break;
		end;
		local v8 = v6:GetAttribute("ID");
		local v9 = v1.Directory.Eggs[v8];
		if v6:GetAttribute("Unlocked") then
			if v9.cost <= v4[v9.currency] then
				AttemptNotification(v8, "Eggs");
			end;
		end;	
	end;
	for v13, v14 in pairs(v1.Directory.Worlds) do
		if v13 then

		else
			break;
		end;
		local v15 = v1.Directory.Worlds[v13];
		if v13 ~= "Spawn" then
			if v15.cost <= v4[v15.currency] then
				AttemptNotification(v13, "Areas");
			end;
		end;	
	end;
end;
v1.Signal.Fired("Stat Changed"):Connect(function(p5)
	if not (not string.find(p5, "Coins")) or p5 == "Gems" or p5 == "AreasUnlocked" then
		CheckForNotifications();
	end;
end);
--[=[
	Loads data. This returns the originally loaded data.
	@param keyName string
	@param defaultValue any?
	@return any?
]=]
function DataStore:Load(keyName, defaultValue)
	return self:_promiseLoad()
		:Then(function(data)
			return self:_afterLoadGetAndApplyStagedData(keyName, data, defaultValue)
		end)
end

function DataStore:_saveData(writer)
	local maid = Maid.new()

	local promise = Promise.new()
	promise:Resolve(maid:GivePromise(DataStorePromises.updateAsync(self._robloxDataStore, self._key, function(data)
		if promise:IsRejected() then
			-- Cancel if we have another request
			return nil
		end

		data = writer:WriteMerge(data or {})
		assert(data ~= DataStoreDeleteToken, "Cannot delete from UpdateAsync")

		if DEBUG_WRITING then
			print("[DataStore] - Writing", game:GetService("HttpService"):JSONEncode(data))
		end

		return data
	end, function(err)
		-- Might be caused by Maid rejecting state
		warn("[DataStore] - Failed to UpdateAsync data", err)
		return Promise.rejected(err)
	end)))

	self._maid._saveMaid = maid

	if self.Saving.Destroy then
		self.Saving:Fire(promise)
	end

	return promise
end

function DataStore:_promiseLoad()
	if self._loadPromise then
		return self._loadPromise
	end

	self._loadPromise = self._maid:GivePromise(DataStorePromises.getAsync(self._robloxDataStore, self._key)
		:Then(function(data)
			if data == nil then
				return {}
			elseif type(data) == "table" then
				return data
			else
				return Promise.rejected("Failed to load data. Wrong type '" .. type(data) .. "'")
			end
		end, function(err)
			-- Log:
			warn("[DataStore] - Failed to GetAsync data", err)
			return Promise.rejected(err)
		end))

	return self._loadPromise
end

return DataStore
--- Cleans up the Tasks assigned to the Maid
-- This Disconnects RBXScriptConnections, Destroys Instances, and calls Functions/callable Tables
function Maid:DoCleaning()
	local Tasks = self._Tasks
	for Name, Task in next, Tasks do
		local Type = typeof(Task)
		local IsTable = Type == "table"
		if Type == "RBXScriptConnection" or IsTable and Task.Disconnect then
			Task:Disconnect()
		elseif Type == "Instance" or IsTable and Task.Destroy then
			Task:Destroy()
		else
			Task()
		end
		Tasks[Name] = nil
	end
end
Maid.Disconnect = Maid.DoCleaning
Maid.Destroy = Maid.DoCleaning
--[[
	Connect to the datastore, set up connections and create resources used by
	the server

	Parameters:
	configValues: A table containing configuration values
]]
local function setup(configValues)
	local tokenDataStore = DataStoreService:GetDataStore(configValues.datastoreName)
	tokenManager = TokenManager.new(tokenDataStore)
	local tokens = CollectionService:GetTagged(configValues.tokenTag)
	local resetOnPlayerRemoving = configValues.resetOnPlayerRemoving

	tokenManager:setTokens(tokens)

	connections[1] = CollectionService
		:GetInstanceAddedSignal(configValues.tokenTag)
		:Connect(onTokenAdded(remoteEvents, tokenManager))
	connections[2] = CollectionService
		:GetInstanceRemovedSignal(configValues.tokenTag)
		:Connect(onTokenRemoved(remoteEvents, tokenManager))
	connections[3] = Players.PlayerAdded:Connect(onPlayerAdded(remoteEvents, tokenDataStore, tokenManager))
	connections[4] = Players.PlayerRemoving:Connect(
		onPlayerRemoved(tokenDataStore, tokenManager, resetOnPlayerRemoving)
	)
	connections[5] = events.disable.Event:Connect(onHuntDisabled(tokenManager))
	connections[6] = events.enable.Event:Connect(onHuntEnabled(tokenManager))
end

config.changed:Connect(function(configValues)
	-- Clean up old data if it exists
	disconnectOldConnections()
	if tokenManager then
		tokenManager:cleanupTokens()
	end

	setup(configValues)
end)

setup(config.getValues())
--[[
	A 'Symbol' is an opaque marker type, implemented to behave similarly to JS:
	https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol
]]
local Symbol = require(script.Symbol)
export type Symbol = Symbol.Symbol
local GlobalRegistry = require(script.GlobalRegistry)

local SymbolObject = setmetatable({}, {
	--[[
		Creates a new symbol, using the given name when printed. Symbols are
		opaque, so this will always create a new, unique object
	]]
	__call = function(_, name: string?): Symbol.Symbol
		return Symbol.new(name)
	end,
})

SymbolObject.for_ = GlobalRegistry.getOrInit

return SymbolObject
--!strict
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local constants = {
	-- The location where all DevModules are moved at runtime. Note that a DevModule
	-- is moved after its scripts and other instances have been moved to their
	-- proper locations. What remains of the DevModule is the Packages folder, and
	-- any ModuleScripts that are used by the DevModule.
	DEV_MODULE_STORAGE = ReplicatedStorage,

	-- DevModules rely on dependencies. By convention, these are stored in a folder
	-- named "Packages" inside the root of the DevModule. At runtime, the Packages
	-- folders from every DevModule are deduplicated, resulting in only one version
	-- of each package in use across all the DevModules in the game
	PACKAGE_NAME = "Packages",
	PACKAGE_STORAGE_LOCATION = ReplicatedStorage,
	PACKAGE_STORAGE_NAME = "DevModulePackages",
	PACKAGE_REF = script.Parent.packageRef,

	-- The version of a package is controlled by a StringValue included as a child
	-- of the package. This constant controls the name of that StringValue.
	--
	-- Initially we wanted to use Attributes for the version, however Rojo does not
	-- support syncing Attributes yet. As such, we've opted to go the old fashioned
	-- way of including a StringValue.
	PACKAGE_VERSION_NAME = "_Version",

	PACKAGE_VERSION_OBJECT_MISSING = "%s is missing a %s StringValue at %s",
	PACKAGE_VERSION_EMPTY = "%s cannot have an empty value for its version at %s",
	ENABLED_SCRIPTS_ERROR = "All scripts included with a DevModule must be Disabled. Please disable the "
		.. "following script(s): %s",
}

return constants
-- Also returns nil for speedyness
function DataStoreStage:_promiseInvokeSavingCallbacks()
	if not next(self._savingCallbacks) then
		return nil
	end

	local removingPromises = {}
	for _, func in pairs(self._savingCallbacks) do
		local result = func()
		if Promise.isPromise(result) then
			table.insert(removingPromises, result)
		end
	end

	for _, substore in pairs(self._stores) do
		local promise = substore:_promiseInvokeSavingCallbacks()
		if promise then
			table.insert(removingPromises, promise)
		end
	end

	return PromiseUtils.all(removingPromises)
end
--[[
	Calls awaitStatus internally, returns (isResolved, values...)
]]
function Promise.prototype:await()
	return awaitHelper(self:awaitStatus())
end
Promise.prototype.Await = Promise.prototype.await

local function expectHelper(status, ...)
	if status ~= Promise.Status.Resolved then
		error((...) == nil and "Expected Promise rejected with no value." or (...), 3)
	end

	return ...
end
--//Services//--
local TweenService = game:GetService("TweenService")
local Debris = game:GetService("Debris")
-- 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(0)
local MAX_Y = math.rad(0)

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_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"))
--//Controller//--
PlayerEvent.OnServerEvent:Connect(function(Player, X, Z)
	if not Chunks:FindFirstChild(X..", "..Z) then
		CreateNewChunk(X, Z)
		
	end
end)
--// V key, Takedown
mouse.KeyDown:connect(function(key)
	if key=="v" then 
		veh.Lightbar.middle.Beep:Play()
		veh.Lightbar.Remotes.TakedownEvent:FireServer(true)
	end
end)
--[[Driver Handling]]

	--Driver Sit	
	car.DriveSeat.ChildAdded:connect(function(child)
		if child.Name=="SeatWeld" and child:IsA("Weld") and game.Players:GetPlayerFromCharacter(child.Part1.Parent)~=nil then
			--Distribute Client Interface
			local p=game.Players:GetPlayerFromCharacter(child.Part1.Parent)
			car.Body.MainPart.Anchored = false
			car.DriveSeat:SetNetworkOwner(p)
			local g=script.Parent["A-Chassis Interface"]:Clone()
			g.Parent=p.PlayerGui
		end
	end)
	
	--Driver Leave
	car.DriveSeat.ChildRemoved:connect(function(child)
		if child.Name=="SeatWeld" and child:IsA("Weld") then
			--Remove Flip Force
			if car.DriveSeat:FindFirstChild("Flip")~=nil then
				car.DriveSeat.Flip.MaxTorque = Vector3.new()
			end
			
			--Remove Wheel Force
			for i,v in pairs(car.Wheels:GetChildren()) do
				if v:FindFirstChild("#AV")~=nil then
					if v["#AV"]:IsA("BodyAngularVelocity") then
						if v["#AV"].AngularVelocity.Magnitude>0 then
							v["#AV"].AngularVelocity = Vector3.new()
							v["#AV"].MaxTorque = Vector3.new()
						end
					else
						if v["#AV"].AngularVelocity>0 then
							v["#AV"].AngularVelocity = 0
							v["#AV"].MotorMaxTorque = 0
						end
					end
				end
			end
		end
-- Get the UI frame by name or reference
local uiFrame = script.Parent.Parent.Background.DesktopIcons
-- SETUP ICON TEMPLATE
local topbarPlusGui = Instance.new("ScreenGui")
topbarPlusGui.Enabled = true
topbarPlusGui.DisplayOrder = 0
topbarPlusGui.IgnoreGuiInset = true
topbarPlusGui.ResetOnSpawn = false
topbarPlusGui.Name = "TopbarPlus"

local activeItems = Instance.new("Folder")
activeItems.Name = "ActiveItems"
activeItems.Parent = topbarPlusGui

local topbarContainer = Instance.new("Frame")
topbarContainer.BackgroundTransparency = 1
topbarContainer.Name = "TopbarContainer"
topbarContainer.Position = UDim2.new(0, 0, 0, 0)
topbarContainer.Size = UDim2.new(1, 0, 0, 36)
topbarContainer.Visible = true
topbarContainer.ZIndex = 1
topbarContainer.Parent = topbarPlusGui
topbarContainer.Active = false

local iconContainer = Instance.new("Frame")
iconContainer.BackgroundTransparency = 1
iconContainer.Name = "IconContainer"
iconContainer.Position = UDim2.new(0, 104, 0, 4)
iconContainer.Visible = false
iconContainer.ZIndex = 1
iconContainer.Parent = topbarContainer
iconContainer.Active = false

local iconButton = Instance.new("TextButton")
iconButton.Name = "IconButton"
iconButton.Visible = true
iconButton.Text = ""
iconButton.ZIndex = 10--2
iconButton.BorderSizePixel = 0
iconButton.AutoButtonColor = false
iconButton.Parent = iconContainer
iconButton.Active = true

local iconImage = Instance.new("ImageLabel")
iconImage.BackgroundTransparency = 1
iconImage.Name = "IconImage"
iconImage.AnchorPoint = Vector2.new(0, 0.5)
iconImage.Visible = true
iconImage.ZIndex = 11--3
iconImage.ScaleType = Enum.ScaleType.Fit
iconImage.Parent = iconButton
iconImage.Active = false

local iconLabel = Instance.new("TextLabel")
iconLabel.BackgroundTransparency = 1
iconLabel.Name = "IconLabel"
iconLabel.AnchorPoint = Vector2.new(0, 0.5)
iconLabel.Position = UDim2.new(0.5, 0, 0.5, 0)
iconLabel.Text = ""
iconLabel.RichText = true
iconLabel.TextScaled = false
iconLabel.ClipsDescendants = true
iconLabel.ZIndex = 11--3
iconLabel.Parent = iconButton
iconLabel.Active = false

local iconGradient = Instance.new("UIGradient")
iconGradient.Name = "IconGradient"
iconGradient.Enabled = true
iconGradient.Parent = iconButton

local iconCorner = Instance.new("UICorner")
iconCorner.Name = "IconCorner"
iconCorner.Parent = iconButton

local iconOverlay = Instance.new("Frame")
iconOverlay.Name = "IconOverlay"
iconOverlay.BackgroundTransparency = 1
iconOverlay.Position = iconButton.Position
iconOverlay.Size = UDim2.new(1, 0, 1, 0)
iconOverlay.Visible = true
iconOverlay.ZIndex = iconButton.ZIndex + 1
iconOverlay.BorderSizePixel = 0
iconOverlay.Parent = iconContainer
iconOverlay.Active = false

local iconOverlayCorner = iconCorner:Clone()
iconOverlayCorner.Name = "IconOverlayCorner"
iconOverlayCorner.Parent = iconOverlay
---------------------------------------------------------------------------------------

local buttons = script.Parent.Parent.Buttons
local title = script.Parent.Parent.Title
local popups = script.Parent.Parent.PopUps
local fade = script.Parent.Parent.Fade
local gameVersion = script.Parent.Parent.GameVersion

local playButton = buttons.Play
local settingsButton = buttons.Settings
local infoButton = buttons.Info
local creditsButton = buttons.Credits
local shopButton = buttons.Shop

local settingsPopup = popups.Settings
local infoPopup = popups.Info
local creditsPopup = popups.Credits
local shopPopup = popups.Shop
-- its best to anchor while welding, and then unanchor when finished
function weld(modelgroup,anchored,cancollide)
	local parts,last = {}
	local function scan(parent)
		for _,v in pairs(parent:GetChildren()) do
			if (v:IsA("BasePart")) then
				if (last) then
					local w = Instance.new("Weld")
					w.Name = ("Weld")
					w.Part0,w.Part1 = last,v
					w.C0 = last.CFrame:inverse()
					w.C1 = v.CFrame:inverse()
					w.Parent = last
				end
				last = v
				table.insert(parts,v)
			end
			scan(v)
		end
	end
	scan(modelgroup)
	for _,v in pairs(parts) do
		v.Anchored=anchored
		v.CanCollide=cancollide
	end
end

weld(script.Parent,true,false)
--Mute players across different servers
local muteConnection = ms:SubscribeAsync(muteTopic, function(message)
	local targetId = message.Data[1]
	local muteLength = message.Data[2]

	for i, plr in pairs(game.Players:GetPlayers()) do
		if plr.UserId == targetId then
			
			channel:MuteSpeaker(plr.Name)

			task.wait(muteLength)
			if plr then
				channel:UnmuteSpeaker(plr.Name)
			end
		end
	end
end)
--------------------[ TWEEN FUNCTIONS ]-----------------------------------------------

function TweenJoint(Joint, NewC0, NewC1, Alpha, Duration)
	coroutine.resume(coroutine.create(function()
		local TweenIndicator = nil --At the current moment, this is how the script determines whether the function is already tweening a joint
		local NewCode = math.random(-1e9, 1e9) --This creates a random code between -1000000000 and 1000000000
		if (not Joint:FindFirstChild("TweenCode")) then --If the joint isn't being tweened, then
			TweenIndicator = Instance.new("IntValue")
			TweenIndicator.Name = "TweenCode"
			TweenIndicator.Value = NewCode
			TweenIndicator.Parent = Joint
		else
			TweenIndicator = Joint.TweenCode
			TweenIndicator.Value = NewCode --If the joint is already being tweened, this will change the code, and the tween loop will stop
		end
		local MatrixCFrame = function(CFPos, CFTop, CFBack)
			local CFRight = CFTop:Cross(CFBack)
			return CF(
				CFPos.x, CFPos.y, CFPos.z,
				CFRight.x, CFTop.x, CFBack.x,
				CFRight.y, CFTop.y, CFBack.y,
				CFRight.z, CFTop.z, CFBack.z
			)
		end
		local LerpCF = function(StartCF, EndCF, Alpha)
			local StartTop = (StartCF * CFANG(RAD(90), 0, 0)).lookVector
			local StartBack = -StartCF.lookVector
			local EndTop = (EndCF * CFANG(RAD(90), 0, 0)).lookVector
			local EndBack = -EndCF.lookVector
			local StartPos = StartCF.p
			local EndPos = EndCF.p
			local NewCF = MatrixCFrame(
				StartPos:lerp(EndPos, Alpha),
				StartTop:lerp(EndTop, Alpha),
				StartBack:lerp(EndBack, Alpha)
			)
			return NewCF
		end
		local StartC0 = Joint.C0
		local StartC1 = Joint.C1
		local X = 0
		while true do
			local NewX = X + math.min(1.5 / math.max(Duration, 0), 90)
			X = (NewX > 90 and 90 or NewX)
			if TweenIndicator.Value ~= NewCode then break end --This makes sure that another tween wasn't called on the same joint
			if (not Selected) then break end --This stops the tween if the tool is deselected
			if NewC0 then Joint.C0 = LerpCF(StartC0, NewC0, Alpha(X)) end
			if NewC1 then Joint.C1 = LerpCF(StartC1, NewC1, Alpha(X)) end
			if X == 90 then break end
			RS:wait() --This makes the for loop step every 1/60th of a second
		end
		if TweenIndicator.Value == NewCode then --If this tween functions was the last one called on a joint then it will remove the code
			TweenIndicator:Destroy()
		end
	end))
end


INSERT(Connections, RS:connect(function()
			local Forward = (Keys["w"] or Keys[string.char(17)])
			local Backward = (Keys["s"] or Keys[string.char(18)])
			local Right = (Keys["d"] or Keys[string.char(19)])
			local Left = (Keys["a"] or Keys[string.char(20)])
			
			local WalkingForward = (Forward and (not Backward))
			local WalkingBackward = ((not Forward) and Backward)
			local WalkingRight = (Right and (not Left))
			local WalkingLeft = ((not Right) and Left)
		end))
		
		INSERT(Connections, RS:connect(function()
			if (not Idleing) and Walking then
					if Stance == 1 then
						Humanoid.WalkSpeed = 7
					elseif Stance == 2 then
						Humanoid.WalkSpeed = 16
					end
			else
				Humanoid.WalkSpeed = 16
			end
		end))
-- ROBLOX MOVED: expect/jasmineUtils.lua
local function equals(a: any, b: any, customTesters: Array<Tester>?, strictCheck: boolean?): boolean
	customTesters = customTesters or {}
	strictCheck = strictCheck or false
	return eq(a, b, {}, {}, customTesters :: Array<Tester>, strictCheck and hasKey or hasDefinedKey)
end
--[[Waiting for Assets]]--

dir = script.Parent
dir:WaitForChild("Content")
c = dir.Content
-- preload all of the faces
for i = 1, #toiletFace do
	Game:GetService("ContentProvider"):Preload("http://www.roblox.com/asset/?id="..tostring(toiletFace[i]))
end
--slow transitions, looks slick
script.Parent.Color = Color3.new(1,0,0) --Color3.new(math.random(), math.random(), math.random()) 
wait(0.2)
script.Parent.Color = Color3.new(.8,.2,0) --Color3.new(math.random(), math.random(), math.random()) 
wait(0.2)
script.Parent.Color = Color3.new(.6,.4,0) --Color3.new(math.random(), math.random(), math.random()) 
wait(0.2)
script.Parent.Color = Color3.new(.4,.6,0) --Color3.new(math.random(), math.random(), math.random()) 
wait(0.2)
script.Parent.Color = Color3.new(.2,.8,0) --Color3.new(math.random(), math.random(), math.random()) 
wait(0.2)
script.Parent.Color = Color3.new(0,1,0) --Color3.new(math.random(), math.random(), math.random()) 
wait(0.2)
script.Parent.Color = Color3.new(0,0.8,.2) --Color3.new(math.random(), math.random(), math.random()) 
wait(0.2)
script.Parent.Color = Color3.new(0,0.6,.4) --Color3.new(math.random(), math.random(), math.random()) 
wait(0.2)
script.Parent.Color = Color3.new(0,0.4,.6) --Color3.new(math.random(), math.random(), math.random()) 
wait(0.2)
script.Parent.Color = Color3.new(0,0.2,.8) --Color3.new(math.random(), math.random(), math.random()) 
wait(0.2)
script.Parent.Color = Color3.new(0,0,1) --Color3.new(math.random(), math.random(), math.random()) 
wait(0.2)
script.Parent.Color = Color3.new(.2,0,.8) --Color3.new(math.random(), math.random(), math.random()) 
wait(0.2)
script.Parent.Color = Color3.new(.4,0,.6) --Color3.new(math.random(), math.random(), math.random()) 
wait(0.2)
script.Parent.Color = Color3.new(.6,0,.4) --Color3.new(math.random(), math.random(), math.random()) 
wait(0.2)
script.Parent.Color = Color3.new(.8,0,.2) --Color3.new(math.random(), math.random(), math.random()) 
wait(0.2)
mode2()
end

function mode3()
--[[
	Shorthand for a finally handler that returns the given value.
]]
function Promise.prototype:finallyReturn(...)
	local length, values = pack(...)
	return self:_finally(debug.traceback(nil, 2), function()
		return unpack(values, 1, length)
	end)
end
Promise.prototype.FinallyReturn = Promise.prototype.finallyReturn
--[[ Script Variables ]]--
while not Players.LocalPlayer do
	task.wait()
end
local LocalPlayer = Players.LocalPlayer
local IsFollowStick = false
local ThumbstickFrame = nil
local MoveTouchObject = nil
local OnTouchEnded = nil		-- defined in Create()
local OnTouchMovedCn = nil
local OnTouchEndedCn = nil
local currentMoveVector = Vector3.new(0,0,0)
-- Listen for players joining the game
game.Players.PlayerAdded:Connect(onPlayerAdded)
--[[
	Returns an estimate of the amount of time a data store request could take to complete given the
	number of attempts, retryConstant, retryExponent and a reasonable worst case estimate for how long
	the DataStoreService call might take to complete.

	See DataStoreWrapper and retryAsync for actual retrying implementations.
--]]

local DATA_STORE_REQUEST_TIME = 3

local function getMaxRequestTime(numAttempts: number, retryConstant: number, retryExponent: number)
	local requestTime = 0

	for attemptNumber = 1, numAttempts do
		requestTime += DATA_STORE_REQUEST_TIME

		if attemptNumber > 1 then
			requestTime += retryConstant + (retryExponent ^ attemptNumber)
		end
	end

	return requestTime
end

return getMaxRequestTime
-- FUNCTIONS --
return function(Action, Variable2, Variable3, Variable4)
	if Action == "Drop" then
		local Dropper = Variable2
		local dropID = Variable3
		local dropValue = Variable4
		local dropPart = Dropper:FindFirstChild("Drop")
		if not dropPart then return end
		
		local currentValue = dropValue
		
		local drop = Ore:Clone()
		drop.Name = Variable3
		drop.Position = dropPart.Attachment.WorldPosition
		drop.Anchored = false
		drop.Parent = workspace.Debris
		game.Debris:AddItem(drop, 10)
		
		local billboardGui = PriceUI:Clone()
		billboardGui.TextLabel.Text = tostring(numShorten(currentValue))
		billboardGui.Parent = drop
		
		drop.Touched:Connect(function(Hit)
			if Hit.Name == "Sell" then
				drop:Destroy()
				print(dropID, " had been sold! - CLIENT")
			elseif Hit.Name == "Upgrade" then
				if not drop:FindFirstChild(Hit.Parent.Name) then
					local upgradeValue = Instance.new("BoolValue")
					upgradeValue.Name = Hit.Parent.Name
					upgradeValue.Parent = drop
					
					Replicate:FireServer("Upgrade", drop.Name, Hit.Parent)
					currentValue = currentValue * Hit.Parent.Data.Upgrade.Value
					billboardGui.TextLabel.Text = tostring(numShorten(currentValue))
				end
			end
		end)
	end
end