Pinkstack/roblox-luau-corpus-text huggingface dataset:
--[=[
	Wraps :SetAsync() in a promise
	@param robloxDataStore DataStore
	@param key string
	@param value string
	@return Promise<boolean>
]=]


function DataStorePromises.setAsync(robloxDataStore, key, value)
	assert(typeof(robloxDataStore) == "Instance", "Bad robloxDataStore")
	assert(type(key) == "string", "Bad key")

	return Promise.spawn(function(resolve, reject)
		local ok, err = pcall(function()
			robloxDataStore:SetAsync(key, value)
		end)
		if not ok then
			return reject(err)
		end
		return resolve(true)
	end)
end
--this returns a region3 that lines up on top of the baseplate to capture
--whatever room has been constructed on top of it, it is smart enough
--to capture a room that has been less-than-ideally set up


function RoomPackager:RegionFromBasePlate(basePlate)
	local topCorners = self:TopCornersOfBasePlate(basePlate)
	
	--we farm the min and max x's and z's from the top corners
	--to get x and z coordinates for the region3 that will contain the room
	--we choose an arbitrary corner so that the initial values are in the data set
	local arbitraryCorner = topCorners[1]
	local minX = arbitraryCorner.X
	local minZ = arbitraryCorner.Z
	local maxX = arbitraryCorner.X
	local maxZ = arbitraryCorner.Z
	for _, corner in pairs(topCorners) do
		minX = math.min(minX, corner.X)
		minZ = math.min(minZ, corner.Z)
		maxX = math.max(maxX, corner.X)
		maxZ = math.max(maxZ, corner.Z)
	end
	
	--construct the region using these new corners we have constructed
	--keeping in mind that all corners in topCorners *should* have the same y value
	local minY = topCorners[1].Y
	local lowerCorner = Vector3.new(minX, minY, minZ)
	local maxY = minY + 64
	local upperCorner = Vector3.new(maxX, maxY, maxZ)
	local region = Region3.new(lowerCorner, upperCorner)
	
	return region
end
--[=[
	Wraps the datastore object to provide async cached loading and saving. See [DataStoreStage] for more API.

	Has the following features
	* Automatic save
	* Jitter
	* De-duplication (only updates data it needs)

	```lua
	local playerMoneyValue = Instance.new("IntValue")
	playerMoneyValue.Value = 0

	local dataStore = DataStore.new(DataStoreService:GetDataStore("test"), test-store")
	dataStore:Load("money", 0):Then(function(money)
		playerMoneyValue.Value = money
		dataStore:StoreOnValueChange("money", playerMoneyValue)
	end):Catch(function()
		-- TODO: Notify player
	end)

	```

	@server
	@class DataStore
]=]



local require = require(script.Parent.loader).load(script)

local DataStoreDeleteToken = require("DataStoreDeleteToken")
local DataStorePromises = require("DataStorePromises")
local DataStoreStage = require("DataStoreStage")
local Maid = require("Maid")
local Promise = require("Promise")
local Signal = require("Signal")

local DEBUG_WRITING = false

local AUTO_SAVE_TIME = 60*5
local CHECK_DIVISION = 15
local JITTER = 20 -- Randomly assign jitter so if a ton of players join at once we don't hit the datastore at once

local DataStore = setmetatable({}, DataStoreStage)
DataStore.ClassName = "DataStore"
DataStore.__index = DataStore
-- listen for jumping and landing and apply sway and camera mvoement to the viewmodel


humanoid.StateChanged:Connect(function(oldstate, newstate)
	if isfirstperson == true and includejumpsway == true then -- dont apply camera/viewmodel changes if we aren't in first person
		if newstate == Enum.HumanoidStateType.Landed then
			-- animate the camera's landing "thump"
			--
			-- tween a dummy cframe value for camera recoil
			local camedit = Instance.new("CFrameValue")
			camedit.Value = CFrame.new(0,0,0)*CFrame.Angles(math.rad(-0.75)*swaysize,0,0)
			local landedrecoil = tweenservice:Create(camedit, TweenInfo.new((0.03*6)/sensitivity, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {Value = CFrame.new(0,0,0)}) ; landedrecoil:Play() ; game:GetService("Debris"):AddItem(landedrecoil, 2)
			landedrecoil.Completed:Connect(function()
				camedit.Value = CFrame.new(0,0,0)*CFrame.Angles(math.rad(0.225)*swaysize,0,0)
				local landedrecovery = tweenservice:Create(camedit, TweenInfo.new((0.03*24)/sensitivity, Enum.EasingStyle.Sine, Enum.EasingDirection.Out), {Value = CFrame.new(0,0,0)}) ; landedrecovery:Play(); game:GetService("Debris"):AddItem(landedrecovery, 3)
			end)
			-- apply the camera adjustments
			spawn(function()
				for i = 1,60 do
					camera.CFrame = camera.CFrame*camedit.Value
					runservice.Heartbeat:Wait()
				end
			end)
			-- animate the jump sway to make the viewmodel thump down on landing
			local viewmodelrecoil = tweenservice:Create(jumpswaygoal, TweenInfo.new(0.15/sensitivity, Enum.EasingStyle.Sine, Enum.EasingDirection.Out), {Value = CFrame.new(0,0,0)*CFrame.Angles(-math.rad(5)*swaysize,0,0)}) ; viewmodelrecoil:Play(); game:GetService("Debris"):AddItem(viewmodelrecoil, 2)
			viewmodelrecoil.Completed:Connect(function()
				local viewmodelrecovery = tweenservice:Create(jumpswaygoal, TweenInfo.new(0.7/sensitivity, Enum.EasingStyle.Quart, Enum.EasingDirection.Out), {Value = CFrame.new(0,0,0)}) ; viewmodelrecovery:Play() ; game:GetService("Debris"):AddItem(viewmodelrecovery, 2)
			end)
		elseif newstate == Enum.HumanoidStateType.Freefall then
			-- animate jump sway when the character is falling or jumping
			local viewmodeljump = tweenservice:Create(jumpswaygoal, TweenInfo.new(0.5/sensitivity, Enum.EasingStyle.Sine), {Value = CFrame.new(0,0,0)*CFrame.Angles(math.rad(7.5)*swaysize,0,0)}) ; viewmodeljump:Play() ; game:GetService("Debris"):AddItem(viewmodeljump, 2)
		end	
	end
end)
--		print("Keyframe : ".. frameName)	


		playToolAnimation(toolAnimName, 0.0, Humanoid)
	end
end


function playToolAnimation(animName, transitionTime, humanoid)	 
		
		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
-- connect up



Humanoid.Died:connect(onSoundDied)
Humanoid.Running:connect(onSoundRunning)
Humanoid.Jumping:connect(function(state) onState(state, sJumping) end)
Humanoid.GettingUp:connect(function(state) onState(state, sGettingUp) end)
Humanoid.FreeFalling:connect(function(state) onState(state, sFreeFalling) end)
Humanoid.FallingDown:connect(function(state) onState(state, sFallingDown) end)

local runService = game:service("RunService");

delay(0, function() 
	while Figure.Parent~=nil do
		local _, time = wait(0.1)
		move(time)
	end
end)
--[[[Default Controls]]


	--Peripheral Deadzones
	Tune.Peripherals = {
		MSteerWidth				= 67		,	-- Mouse steering control width	(0 - 100% of screen width)
		MSteerDZone				= 10		,	-- Mouse steering deadzone (0 - 100%)
		
		ControlLDZone			= 5			,	-- Controller steering L-deadzone (0 - 100%)
		ControlRDZone			= 5			,	-- Controller steering R-deadzone (0 - 100%)
	}
	
	--Control Mapping
	Tune.Controls = {
		
	--Keyboard Controls
		--Mode Toggles
		ToggleABS				= Enum.KeyCode.Y					,
		ToggleTransMode			= Enum.KeyCode.M					,
		--Primary Controls
		Throttle				= Enum.KeyCode.Up					,
		Brake					= Enum.KeyCode.Down					,
		SteerLeft				= Enum.KeyCode.Left					,
		SteerRight				= Enum.KeyCode.Right				,
		
		--Secondary Controls
		Throttle2				= Enum.KeyCode.W					,
		Brake2					= Enum.KeyCode.S					,
		SteerLeft2				= Enum.KeyCode.A					,
		SteerRight2				= Enum.KeyCode.D					,
		
		--Manual Transmission
		ShiftUp					= Enum.KeyCode.E					,
		ShiftDown				= Enum.KeyCode.Q					,
		Clutch					= Enum.KeyCode.LeftShift			,
		
		--Handbrake
		PBrake					= Enum.KeyCode.P					,
		
	--Mouse Controls
		MouseThrottle			= Enum.UserInputType.MouseButton1	,
		MouseBrake				= Enum.UserInputType.MouseButton2	,
		MouseClutch				= Enum.KeyCode.W					,
		MouseShiftUp			= Enum.KeyCode.E					,
		MouseShiftDown			= Enum.KeyCode.Q					,
		MousePBrake				= Enum.KeyCode.LeftShift			,
		
	--Controller Mapping
		ContlrThrottle			= Enum.KeyCode.ButtonR2				,
		ContlrBrake				= Enum.KeyCode.ButtonL2				,
		ContlrSteer				= Enum.KeyCode.Thumbstick1			,
		ContlrShiftUp			= Enum.KeyCode.ButtonY				,
		ContlrShiftDown			= Enum.KeyCode.ButtonX				,
		ContlrClutch			= Enum.KeyCode.ButtonR1				,
		ContlrPBrake			= Enum.KeyCode.ButtonB				,
		ContlrToggleTMode		= Enum.KeyCode.DPadUp				,
		ContlrToggleTCS			= Enum.KeyCode.DPadDown				,
		ContlrToggleABS			= Enum.KeyCode.DPadRight			,
	}
--		print("Wha " .. pose)


		amplitude = 0.1
		frequency = 1
		setAngles = true
	end

	if (setAngles) then
		desiredAngle = amplitude * math.sin(time * frequency)

		RightShoulder:SetDesiredAngle(desiredAngle + climbFudge)
		LeftShoulder:SetDesiredAngle(desiredAngle - climbFudge)
		RightHip:SetDesiredAngle(-desiredAngle)
		LeftHip:SetDesiredAngle(-desiredAngle)
	end

	-- Tool Animation handling
	local tool = getTool()
	if tool then
	
		animStringValueObject = getToolAnim(tool)

		if animStringValueObject then
			toolAnim = animStringValueObject.Value
			-- message recieved, delete StringValue
			animStringValueObject.Parent = nil
			toolAnimTime = time + .3
		end

		if time > toolAnimTime then
			toolAnimTime = 0
			toolAnim = "None"
		end

		animateTool()		
	else
		stopToolAnimations()
		toolAnim = "None"
		toolAnimTime = 0
	end
end
--[[

	NumberUtil.E
	NumberUtil.Tau

	NumberUtil.Lerp(min, max, alpha)
	NumberUtil.LerpClamp(min, max, alpha)
	NumberUtil.InverseLerp(min, max, num)
	NumberUtil.Map(num, inMin, inMax, outMin, outMax)
	NumberUtil.Round(num)
	NumberUtil.RoundTo(num, multiple)


	EXAMPLES:

		Lerp:

			Interpolate between two numbers by a certain alpha/percentage.

			Visually, think of a number line ranging from 'min' to 'max'
			and then move along that line by 'alpha' percent.

			Lerp(5, 15, 0.5) == 10
			Lerp(5, 15, 0)   == 5
			Lerp(5, 15, 0.7) == 12
			Lerp(5, 15, 2)   == 25  (unusual to have alpha outside of 0-1. See LerpClamp.)


		LerpClamp:

			The same as Lerp, but the 'alpha' value is clamped between 0-1,
			which will guarantee that the output is within bounds of the
			min and max values.

			LerpClamp(5, 15, 0.5) == 10
			LerpClamp(5, 15, 2)   == 15  (alpha of 2 was clamped down to 1)


		InverseLerp:

			The inverse of the Lerp function. It returns the alpha value
			between the range of [min, max] given the number.

			InverseLerp(5, 15, 10) == 0.5
			InverseLerp(5, 15, 12) == 0.7

		Map:

			Remaps the range of 'num' from its old range of [inMin, inMax]
			to a new range of [outMin, outMax]. This is useful when needing
			to convert a range of inputs to a different output. For instance,
			remapping gamepad stick input to a larger range controlling a
			vehicle steering wheel.

			Map(0.5, 0, 1, -10, 10) == 0
			Map(1, -1, 1, 0, 5)     == 5


		Round:

			Rounds a number to the nearest whole number.

			Round(1.5)  == 2
			Round(3.2)  == 3
			Round(-0.5) == -1


		RoundTo:

			Rounds a number to the nearest given multiple. An example would be
			locking world positions onto a larger grid.

			RoundTo(3.4, 5) == 5
			RoundTo(12, 5)  == 10

--]]




local NumberUtil = {}


NumberUtil.E = 2.7182818284590
NumberUtil.Tau = math.pi * 2


function NumberUtil.Lerp(min, max, alpha)
	return (min + ((max - min) * alpha))
end


function NumberUtil.LerpClamp(min, max, alpha)
	return NumberUtil.Lerp(min, max, math.clamp(alpha, 0, 1))
end


function NumberUtil.InverseLerp(min, max, num)
	return ((num - min) / (max - min))
end


function NumberUtil.Map(n, inMin, inMax, outMin, outMax)
	return (outMin + ((outMax - outMin) * ((n - inMin) / (inMax - inMin))))
end


function NumberUtil.Round(num)
	return (num >= 0 and math.floor(num + 0.5) or math.ceil(num - 0.5))
end


function NumberUtil.RoundTo(num, multiple)
	return NumberUtil.Round(num / multiple) * multiple
end


return NumberUtil
--Precalculated paths


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



local Selected = false

local Idleing = false
local Walking = true
local Running = false

local Aimed = false
local Aiming = false

local Reloading = true
local BreakReload = false

local Knifing = true
local ThrowingGrenade = false

local MB1_Down = false

local CanFire = true

local KnifeReady = true

local CanRun = true
local RunTween = false
local Run_Key_Pressed = false
local ChargingStamina = false

local AimingIn = false
local AimingOut = false

local Stamina = S.SprintTime * 60
local CurrentSteadyTime = S.ScopeSteadyTime * 60

local CameraSteady = false
local TakingBreath = false

local Grip = nil
local Aimed_GripCF = nil

local Gui_Clone = nil

local CurrentSpread = S.Spread.Hipfire
local CurrentRecoil = S.Recoil.Hipfire

local AmmoInClip = 0

local Stance = 0
local StanceSway = 1
local CameraSway = 1

local HeadRot = 0
local ArmTilt = 0

local LastBeat = 0

local Parts = {}

local Connections = {}

local PrevNeckCF = {
	C0 = nil;
	C1 = nil;
}

local Keys = {}
--[[
	Creates a Promise that resolves after given number of seconds.
]]


do
	-- uses a sorted doubly linked list (queue) to achieve O(1) remove operations and O(n) for insert

	-- the initial node in the linked list
	local first
	local connection

	function Promise.delay(seconds)
		assert(type(seconds) == "number", "Bad argument #1 to Promise.delay, must be a number.")
		-- If seconds is -INF, INF, NaN, or less than 1 / 60, assume seconds is 1 / 60.
		-- This mirrors the behavior of wait()
		if not (seconds >= 1 / 60) or seconds == math.huge then
			seconds = 1 / 60
		end

		return Promise._new(debug.traceback(nil, 2), function(resolve, _, onCancel)
			local startTime = Promise._getTime()
			local endTime = startTime + seconds

			local node = {
				resolve = resolve,
				startTime = startTime,
				endTime = endTime,
			}

			if connection == nil then -- first is nil when connection is nil
				first = node
				connection = Promise._timeEvent:Connect(function()
					local threadStart = Promise._getTime()

					while first ~= nil and first.endTime < threadStart do
						local current = first
						first = current.next

						if first == nil then
							connection:Disconnect()
							connection = nil
						else
							first.previous = nil
						end

						current.resolve(Promise._getTime() - current.startTime)
					end
				end)
			else -- first is non-nil
				if first.endTime < endTime then -- if `node` should be placed after `first`
					-- we will insert `node` between `current` and `next`
					-- (i.e. after `current` if `next` is nil)
					local current = first
					local next = current.next

					while next ~= nil and next.endTime < endTime do
						current = next
						next = current.next
					end

					-- `current` must be non-nil, but `next` could be `nil` (i.e. last item in list)
					current.next = node
					node.previous = current

					if next ~= nil then
						node.next = next
						next.previous = node
					end
				else
					-- set `node` to `first`
					node.next = first
					first.previous = node
					first = node
				end
			end

			onCancel(function()
				-- remove node from queue
				local next = node.next

				if first == node then
					if next == nil then -- if `node` is the first and last
						connection:Disconnect()
						connection = nil
					else -- if `node` is `first` and not the last
						next.previous = nil
					end
					first = next
				else
					local previous = node.previous
					-- since `node` is not `first`, then we know `previous` is non-nil
					previous.next = next

					if next ~= nil then
						next.previous = previous
					end
				end
			end)
		end)
	end
end
--[[Engine]]


	--Torque Curve
	Tune.Horsepower		= 180		--	[TORQUE CURVE VISUAL]
	Tune.IdleRPM		= 700		--		https://www.desmos.com/calculator/2uo3hqwdhf
	Tune.PeakRPM		= 6000		--		Use sliders to manipulate values
	Tune.Redline		= 6700		--		Copy and paste slider values into the respective tune values
	Tune.EqPoint		= 5500
	Tune.PeakSharpness	= 7.5
	Tune.CurveMult		= 0.16
	
	--Incline Compensation
	Tune.InclineComp	= 1.7			-- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
	
	--Misc
	Tune.RevAccel		= 150		-- RPM acceleration when clutch is off
	Tune.RevDecay		= 75		-- RPM decay when clutch is off
	Tune.RevBounce		= 500		-- RPM kickback from redline
	Tune.IdleThrottle	= 3			-- Percent throttle at idle
	Tune.ClutchTol		= 500		-- Clutch engagement threshold (higher = faster response)
-- изменение размера сервисом 
-- если нужно дождаться окончания, то нужен таймер ожидания 


me:TweenSize(
	UDim2.new(1, 0, 0, 0),  	-- endSize (required)
	Enum.EasingDirection.InOut, -- easingDirection (default Out) - https://developer.roblox.com/en-us/api-reference/enum/EasingDirection
	Enum.EasingStyle.Linear,    -- easingStyle (default Quad) - https://developer.roblox.com/en-us/api-reference/enum/EasingStyle
	timer                       -- time (default: 1)
)
wait(timer)		-- задержка
--/////////////////////////////////////////////////////////--



local curSize
local create
local Expand
local doHide
local doClose
local dragSize
local isVisible
local DoRefresh
local getNextPos
local wallPosition
local setPosition
local checkMouse
local isInFrame
local setSize
local apiIfy

client = nil
cPcall = nil
Pcall = nil
Routine = nil
service = nil
GetEnv = nil

local function isGui(child)
	return child:IsA("GuiObject");
end
--[[local sounds={
	waitForChild(Torso,"GroanSound"),
	waitForChild(Torso,"RawrSound")
}]]



if healthregen then
	local regenscript=waitForChild(sp,"HealthRegenerationScript")
	regenscript.Disabled=false
end
Humanoid.WalkSpeed=wonderspeed

local toolAnim="None"
local toolAnimTime=0
--Optimization--


local rad = math.rad
local random = math.random
local NewCFrame = CFrame.new
local Angles = CFrame.Angles
local NewVector = Vector3.new
local CFLookAt = CFrame.lookAt
local NewInstance = Instance.new
local NewNumberSequence = NumberSequence.new
local NewColorSequence = ColorSequence.new
local ColorKeypoint = ColorSequenceKeypoint.new
local NumberKeypoint = NumberSequenceKeypoint.new
-- Returns true if the client is
-- currently in first person.



function FpsCamera:IsInFirstPerson()
	local camera = workspace.CurrentCamera
	
	if camera then
		if camera.CameraType.Name == "Scriptable" then
			return false
		end
		
		local focus = camera.Focus.Position
		local origin = camera.CFrame.Position
		
		return (focus - origin).Magnitude <= 1
	end
	
	return false
end
--[=[
	Converts to the string to `lowerCamelCase` from `camelCase` or `snakeCase` or `YELL_CASE`
	@param str string
	@return string
]=]


function String.toLowerCamelCase(str: string): string
	str = str:lower()
	str = str:gsub("[ _](%a)", string.upper)
	str = str:gsub("^%a", string.lower)
	str = str:gsub("%p", "")

	return str
end
--CHANGE THE NAME, COPY ALL BELOW, AND PAST INTO COMMAND BAR



local TycoonName = "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
--[[
Creating a message creator module:
1) Create a new module inside the MessageCreatorModules folder.
2) Create a function that takes a messageData object and returns:
{
	KEY_BASE_FRAME = BaseFrame,
	KEY_BASE_MESSAGE = BaseMessage,
	KEY_UPDATE_TEXT_FUNC = function(newMessageObject) ---Function to update the text of the message.
	KEY_GET_HEIGHT = function() ---Function to get the height of the message in absolute pixels,
	KEY_FADE_IN = function(duration, CurveUtil) ---Function to tell the message to start fading in.
	KEY_FADE_OUT = function(duration, CurveUtil) ---Function to tell the message to start fading out.
	KEY_UPDATE_ANIMATION = function(dtScale, CurveUtil) ---Update animation function.
}
3) return the following format from the module:
{
	KEY_MESSAGE_TYPE = "Message type this module creates messages for."
	KEY_CREATOR_FUNCTION = YourFunctionHere
}
--]]



local DEFAULT_MESSAGE_CREATOR = "UnknownMessage"
local MESSAGE_CREATOR_MODULES_VERSION = 1
--This is just some simple server script that moves the object around every frame
--The kinematics module handles the rest



game["Run Service"].Heartbeat:Connect(function(deltaTime)
	
	local speed = script:GetAttribute("speed") or Vector3.zero
	local size = script:GetAttribute("size") or 3
	total+=deltaTime
	part.CFrame = startPos * CFrame.new(Vector3.new(math.sin(total*speed.x)*size,math.sin(total*speed.y)*size, math.sin(total*speed.z)*size))
	
end)