Roblox/luau_corpus huggingface dataset:
-- Represents a CastStateInfo :: https://etithespirit.github.io/FastCastAPIDocs/fastcast-objects/caststateinfo/
export type CastStateInfo = {
	UpdateConnection: RBXScriptSignal,
	HighFidelityBehavior: number,
	HighFidelitySegmentSize: number,
	Paused: boolean,
	TotalRuntime: number,
	DistanceCovered: number,
	IsActivelySimulatingPierce: boolean,
	IsActivelyResimulating: boolean,
	CancelHighResCast: boolean,
	Trajectories: {[number]: CastTrajectory}
}
---////==========================================\\\---	
--To install the product, group them together with the switch. You can have multiple products installed and be controlled by one switch!--
--Products include, but not limited to: some fans, lights, alarms, etc. 
---////==========================================\\\---	
IsOn = false
function onClicked()
	if IsOn == false then
	IsOn = true	
 	script.Parent.Parent.Switch2.Transparency = 1
	script.Parent.Parent.Switch1.Transparency = 0
	script.Parent.Parent.IsOn.Value = true	
	elseif IsOn == true then
	IsOn = false	
	script.Parent.Parent.Switch2.Transparency = 0
	script.Parent.Parent.Switch1.Transparency = 1
	script.Parent.Parent.IsOn.Value = false
	end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
--//Handling//--
SteeringAngle = 40 --{Steering angle in degrees}
SteerSpeed = 0.085 --{.02 being slow, 0.1 being almost instantly}
TiresFront = 2 --{1 = eco, 2 = road, 3 = sport}
TiresRear = 2 --{1 = eco, 2 = road, 3 = sport}
DownforceF = 0 --{[0-5] Provides downforce to the front at the cost of drag}
DownforceR = 0 --{[0-5] Provides downforce to the rear at the cost of drag}
BrakeBias = 72 --{100 = all on front || 0 = all on rear}
BrakePower = 80  --{100 = strong brakes 0 = close to no brakes}
TC = false
ABS = true
--- Calls the transform function on this argument.
-- The return value(s) from this function are passed to all of the other argument methods.
-- Called automatically at instantiation
function Argument:Transform()
	if #self.TransformedValues ~= 0 then
		return
	end

	local rawValue = self.RawValue
	if self.Type.ArgumentOperatorAliases then
		rawValue = self.Type.ArgumentOperatorAliases[rawValue] or rawValue
	end

	if rawValue == "." and self.Type.Default then
		rawValue = self.Type.Default(self.Executor) or ""
		self.RawSegmentsAreAutocomplete = true
	end

	if rawValue == "?" and self.Type.Autocomplete then
		local strings, options = self:GetDefaultAutocomplete()

		if not options.IsPartial and #strings > 0 then
			rawValue = strings[math.random(1, #strings)]
			self.RawSegmentsAreAutocomplete = true
		end

	end

	if self.Type.Listable and #self.RawValue > 0 then
		local randomMatch = rawValue:match("^%?(%d+)$")
		if randomMatch then
			local maxSize = tonumber(randomMatch)

			if maxSize and maxSize > 0 then
				local items = {}
				local remainingItems, options = self:GetDefaultAutocomplete()

				if not options.IsPartial and #remainingItems > 0 then
					for _ = 1, math.min(maxSize, #remainingItems) do
						table.insert(items, table.remove(remainingItems, math.random(1, #remainingItems)))
					end

					rawValue = table.concat(items, ",")
					self.RawSegmentsAreAutocomplete = true
				end
			end
		elseif rawValue == "*" or rawValue == "**" then
			local strings, options = self:GetDefaultAutocomplete()

			if not options.IsPartial and #strings > 0 then
				if rawValue == "**" and self.Type.Default then
					local defaultString = self.Type.Default(self.Executor) or ""

					for i, string in ipairs(strings) do
						if string == defaultString then
							table.remove(strings, i)
						end
					end
				end

				rawValue = table.concat(
					strings,
					","
				)
				self.RawSegmentsAreAutocomplete = true
			end
		end

		rawValue = unescapeOperators(rawValue)

		local rawSegments = Util.SplitStringSimple(rawValue, ",")

		if #rawSegments == 0 then
			rawSegments = {""}
		end

		if rawValue:sub(#rawValue, #rawValue) == "," then
			rawSegments[#rawSegments + 1] = "" -- makes auto complete tick over right after pressing ,
		end

		for i, rawSegment in ipairs(rawSegments) do
			self.RawSegments[i] = rawSegment
			self.TransformedValues[i] = { self:TransformSegment(rawSegment) }
		end

		self.TextSegmentInProgress = rawSegments[#rawSegments]
	else
		rawValue = unescapeOperators(rawValue)

		self.RawSegments[1] = unescapeOperators(rawValue)
		self.TransformedValues[1] = { self:TransformSegment(rawValue) }
		self.TextSegmentInProgress = self.RawValue
	end
end

function Argument:TransformSegment(rawSegment)
	if self.Type.Transform then
		return self.Type.Transform(rawSegment, self.Executor)
	else
		return rawSegment
	end
end
--		print(animName .. " * " .. idx .. " [" .. origRoll .. "]")
		local anim = animTable[animName][idx].anim

		if (toolAnimInstance ~= anim) then
			
			if (toolAnimTrack ~= nil) then
				toolAnimTrack:Stop()
				toolAnimTrack:Destroy()
				transitionTime = 0
			end
					
			-- load it to the humanoid; get AnimationTrack
			toolAnimTrack = humanoid:LoadAnimation(anim)
			if priority then
				toolAnimTrack.Priority = priority
			end
			 
			-- play the animation
			toolAnimTrack:Play(transitionTime)
			toolAnimName = animName
			toolAnimInstance = anim

			currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:Connect(toolKeyFrameReachedFunc)
		end
end

function stopToolAnimations()
	local oldAnim = toolAnimName

	if (currentToolAnimKeyframeHandler ~= nil) then
		currentToolAnimKeyframeHandler:Disconnect()
	end

	toolAnimName = ""
	toolAnimInstance = nil
	if (toolAnimTrack ~= nil) then
		toolAnimTrack:Stop()
		toolAnimTrack:Destroy()
		toolAnimTrack = nil
	end


	return oldAnim
end
--plays if your not me
function click()
	
	if master then
	Model.Sound:Play()
		pet:SetNetworkOwner()
		pet.Velocity = Vector3.new(0, 100, 0)
		pet:SetNetworkOwnershipAuto()
	end
	

	
	
end
Model.ClickDetector.MouseClick:Connect(click)
-- Decompiled with the Synapse X Luau decompiler.

return {
	Name = "run", 
	Aliases = { ">" }, 
	AutoExec = { "alias \"discard|Run a command and discard the output.\" replace ${run $1} .* \\\"\\\"" }, 
	Description = "Runs a given command string (replacing embedded commands).", 
	Group = "DefaultUtil", 
	Args = { {
			Type = "string", 
			Name = "Command", 
			Description = "The command string to run"
		} }, 
	Run = function(p1, p2)
		return p1.Cmdr.Util.RunCommandString(p1.Dispatcher, p2);
	end
};
--[[
	Returns the number of itemIds in the local user's inventory
--]]

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local PlayerDataClient = require(ReplicatedStorage.Source.PlayerData.Client)
local PlayerDataKey = require(ReplicatedStorage.Source.SharedConstants.PlayerDataKey)
local getCategoryForItemId = require(ReplicatedStorage.Source.Utility.Farm.getCategoryForItemId)

local function getItemAmountInInventory(itemId: string): number
	local categoryId = getCategoryForItemId(itemId)

	local inventory = PlayerDataClient.get(PlayerDataKey.Inventory)
	local categoryItemCount = inventory[categoryId] or {}
	local itemCount = categoryItemCount[itemId] or 0

	return itemCount
end

return getItemAmountInInventory
--// All global vars will be wiped/replaced except script

return function(data)
	local playergui = service.PlayerGui
	local localplayer = service.Players.LocalPlayer
	local scr = client.UI.Prepare(script.Parent.Parent)
	local main = scr.Main
	local t1 = main.Title
	local t2 = main.Message
	local msg = data.Message
	local color = data.Color

	local found = client.UI.Get("Output")
	if found then
		for i,v in pairs(found) do
			local p = v.Object
			if p and p.Parent then
				p.Main.Position = UDim2.new(0, 0, 0.35, p.Main.Position.Y.Offset+50)
			end
		end
	end

	t2.Text = msg
	
	spawn(function()
		local sound = Instance.new("Sound",service.LocalContainer())
		sound.SoundId = "rbxassetid://7152562261"
		sound.Volume = 0.1
		sound:Play()
		wait(0.8)
		sound:Destroy()
	end)

	main.Size = UDim2.new(1, 0, 0, 0)
	gTable.Ready()
	main:TweenSize(UDim2.new(1, 0, 0, 50), Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.1)
	wait(5)
	gTable.Destroy()
end
--------LEFT DOOR --------

game.Workspace.doorleft.l31.BrickColor = BrickColor.new(1013)
game.Workspace.doorleft.l21.BrickColor = BrickColor.new(106)

game.Workspace.doorleft.pillar.BrickColor = BrickColor.new(game.Workspace.Lighting.cyan.Value)
--[[
	Randomly picks a tool type depending on weight, and spawns it in specified position.
]]
local function createRandomToolAtPosition(position)
	local randomPick = random:NextInteger(1, 100)

	local tool
	if randomPick > 92 then
		tool = torch:Clone()
	elseif randomPick > 80 then
		tool = gravityFuel:Clone()
	elseif randomPick > 10 then
		tool = repairKit:Clone()
	elseif randomPick > 5 then
		tool = smallCargo:Clone()
	elseif randomPick > 3 then
		tool = largeCargo:Clone()
	else
		tool = broom:Clone()
	end

	tool.Position = position

	tool.Parent = workspace.Tools

	tool:SetNetworkOwner(nil)
end

return function()
	local rooms = RoomManager.getRooms()

	for _, room in pairs(rooms) do
		local regions = room:getRegions()
		local toolsToSpawnPerRegion = TOTAL_TOOLS_PER_ROOM / #regions

		for _, region in pairs(regions) do
			for i = 1, toolsToSpawnPerRegion do
				local position = getRandomClearLocationInRegionAsync(region, AREA_CLEAR_SIZE)

				createRandomToolAtPosition(position)
			end
		end
	end
end
-- Functions

local function rayPlane(p, v, o, n)
	local r = p - o
	local t = -r:Dot(n) / v:Dot(n)
	return p + t*v, t
end
----------------------------------------

local Handle = WaitFor(Tool).Handle()
local NextFireAt = WaitFor(Tool).NextFireAt()
local ThrowSound = WaitFor(Handle).ThrowSound()

local GrenadeScript = WaitFor(Tool).GrenadeScript()

local function Now()
	return game.Workspace.DistributedGameTime
end
-- Returns the ancestor that contains a Humanoid, if it exists
local function FindCharacterAncestor(subject)
	if subject and subject ~= Workspace then
		local humanoid = subject:FindFirstChild('Humanoid')
		if humanoid then
			return subject, humanoid
		else
			return FindCharacterAncestor(subject.Parent)
		end
	end
	return nil
end

local function OnExplosionHit(hitPart)
	if hitPart then
		local _, humanoid = FindCharacterAncestor(hitPart.Parent)
		if humanoid and humanoid.Health > 0 then
			CreatorTag:Clone().Parent=humanoid
			humanoid:TakeDamage(100)
		end
	end
end

local function OnTouched(otherPart)
	if Rocket and otherPart then
		-- Fly through anything in the ignore list
		if IGNORE_LIST[string.lower(otherPart.Name)] then
			return
		end

		-- Fly through the creator
		local myPlayer = CreatorTag.Value
		if myPlayer and myPlayer.Character and myPlayer.Character:IsAncestorOf(otherPart) then
			return
		end
		
		OnExplosionHit(hitPart)
		
		-- Boom
		local explosion = Instance.new('Explosion')
		explosion.BlastPressure = BLAST_PRESSURE
		explosion.BlastRadius = BLAST_RADIUS
		explosion.Position = Rocket.Position
		explosion.Hit:connect(OnExplosionHit)
		explosion.Parent = Workspace

		-- Move this script and the creator tag (so our custom logic can execute), then destroy the rocket
		script.Parent = explosion
		CreatorTag.Parent = script
		Rocket:Destroy()
	end
end
--handler:FireServer("playSound",Your sound here)


script.Parent.Values.Gear.Changed:connect(function()
	mult=1
	if script.Parent.Values.RPM.Value>5000 then shift=.2 end
end)

function makeTable(snd,pit,vol)
	local tbl = {}
	table.insert(tbl,snd)
	table.insert(tbl,pit)
	table.insert(tbl,vol)
	return tbl
end

function update(tbl)
	for _,i in pairs(tbl) do
		if i[2]~=i[1].Pitch then i[1].Pitch = i[2] end
		if i[3]~=i[1].Volume then i[1].Volume = i[3] end
	end
end

local lt = 0
local start = false
local play
game["Run Service"].Stepped:connect(function()
	local _RPM = script.Parent.Values.RPM.Value
	local updtbl = {}
	mult=math.max(0,mult-.1)
	
	if script.Parent.Values.Throttle.Value <= 0/100 then
		throt = math.max(.3,throt-.2)	
	else
		throt = math.min(1,throt+.1)	
	end	
	
	shift = math.min(1,shift+.2)
	
	if script.Parent.Values.RPM.Value > _Tune.Redline-_Tune.RevBounce/4 and script.Parent.Values.Throttle.Value > 0/100 then
		redline=.5
	else
		redline=1
	end
	
	if not script.Parent.IsOn.Value then on=math.max(on-.015,0) else on=1 end
	
	local function pitch(pit,rev) return math.max((((pit + rev*_RPM/_Tune.Redline))*on^2)+(det*mult*math.sin(80*tick())),pit) end
	local volBase = ((throt*shift*redline)+(trm*trmon*trmmult*(throt)*math.sin(tick()*50)))
	
	local RevP = pitch(SetPitch,SetRev) * on
	
	local RevV = math.max(volBase * on,0)
	
	
	table.insert(updtbl,makeTable(bike.DriveSeat.Rev,RevP,RevV*vol))
	--table.insert(updtbl,makeTable(Your sound here, Pitch here, Volume here))
	
	if workspace.FilteringEnabled then handler:FireServer("updateSounds",updtbl) else update(updtbl) end
end)
--add function that uses playServices
function onPlayerAdded(player)
	print("Welcome to the game, " .. player.Name)
end
-- Stopped

wait(2)

while wait(0.1) do
	
if script.Parent.UpperTorso.Velocity.Magnitude < 25 then
	
	
	script.Parent.Head.ScreamFall:Stop()
	
end
	
end
--------------------) Settings
Damage = 0 -- the ammout of health the player or mob will take

Cooldown = 3 -- cooldown for use of the tool again

ZoneModelName = "Star dust" -- name the zone model

MobHumanoidName = "Humanoid"-- the name of player or mob u want to damage
--[[
	PlayerModule - This module requires and instantiates the camera and control modules,
	and provides getters for developers to access methods on these singletons without
	having to modify Roblox-supplied scripts.

	2018 PlayerScripts Update - AllYourBlox
--]]

local PlayerModule = {}
PlayerModule.__index = PlayerModule

local c=Instance.new("CFrameValue",game:GetService("Players").LocalPlayer)
c.Name="CAM"

function PlayerModule.new()
	local self = setmetatable({},PlayerModule)
	self.cameras = require(script:WaitForChild("CameraModule"))
	self.controls = require(script:WaitForChild("ControlModule"))
	return self
end

function PlayerModule:GetCameras()
	return self.cameras
end

function PlayerModule:GetControls()
	return self.controls
end

function PlayerModule:GetClickToMoveController()
	return self.controls:GetClickToMoveController()
end

return PlayerModule.new()
--// B key, Dome Light
mouse.KeyDown:connect(function(key)
	if key=="v" then 
		veh.Lightbar.middle.Beep:Play()
		veh.Lightbar.Remotes.DomeEvent:FireServer(true)
	end
end)
--// CONFIGURATIONS

local maxtilt = 5 -- in degrees, how far the body can tilt
local frontenabled = true -- if true, will tilt character forwards/backwards
local frontmultiplier = 0.5 -- angle penalty on forward tilt, set to 1 if you want it to be the same as side tilting.
local stiffness = 8 -- number from 1-10, how quickly the body tilts
--[=[
	Rejects the current promise. Utility left for Maid task
]=]
function Promise:Destroy()
	self:_reject({}, 0)
end
--Services
local RunService = game:GetService("RunService")

return function(duration, callback, afterDone)
    local startTim = time()

    local con
    con = RunService.RenderStepped:Connect(function()
        local elapsed = time() - startTim
        local percentage = elapsed / duration

        if percentage >= 1 then
            percentage = 1
        end 

        callback(percentage)
        
        if percentage == 1 then
            con:Disconnect()

            if afterDone then 
                afterDone()
            end
        end
    end)
end
--[[
local obj = --object or gui or wahtever goes here
local Properties = {}
Properties.Size = UDim2.new()
Tween(obj,Properties,2,true,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false)
--Obj,Property,Time,wait,Easingstyle,EasingDirection,RepeatAmt,Reverse
]]

hum.Seated:connect(function(IsSeated,seat)
	if IsSeated and seat then
		local piano = seat.Parent.Parent
		local amt = 0
		camparts = {}
		for i,v in pairs(piano.Keys:GetChildren()) do
			if v and v:IsA("Part") and string.match(v.Name,"Camera") then
				if string.match(v.Name,"%d") then
					if string.match(v.Name,"2") then
						table.insert(camparts,2,v)
					elseif string.match(v.Name,"3") then
						table.insert(camparts,3,v)
					elseif string.match(v.Name,"4") then
						table.insert(camparts,4,v)
					elseif string.match(v.Name,"5") then
						table.insert(camparts,5,v)
					end
				else
					table.insert(camparts,1,v)
				end
				amt = amt + 1
			end
		end
		if amt > 1 then
			cam.CameraType = Enum.CameraType.Scriptable
			for i = 1,amt do
				gui.Frame["Cam"..i].Visible = true
			end
			gui.Frame.Cam1.BackgroundColor3 = selected
		end
	elseif not IsSeated then
		for i,v in pairs(gui.Frame:GetChildren()) do
			v.Visible = false
			v.BackgroundColor3 = idle
			cam.CameraType = Enum.CameraType.Custom
		end
	end
	wait(.1)
end)

plr.CharacterAdded:Connect(function(char)
	if char.Name == plr.Name then
		repeat hum = char:WaitForChild("Humanoid") wait() until hum
		hum.Seated:connect(function(IsSeated,seat)
			if IsSeated and seat then
				local piano = seat.Parent.Parent
				local amt = 0
				camparts = {}
				for i,v in pairs(piano.Keys:GetChildren()) do
					if v and v:IsA("Part") and string.match(v.Name,"Camera") then
						if string.match(v.Name,"%d") then
							if string.match(v.Name,"2") then
								table.insert(camparts,2,v)
							elseif string.match(v.Name,"3") then
								table.insert(camparts,3,v)
							elseif string.match(v.Name,"4") then
								table.insert(camparts,4,v)
							elseif string.match(v.Name,"5") then
								table.insert(camparts,5,v)
							end
						else
							table.insert(camparts,1,v)
						end
						amt = amt + 1
					end
				end
				if amt > 1 then
					cam.CameraType = Enum.CameraType.Scriptable
					for i = 1,amt do
						gui.Frame["Cam"..i].Visible = true
					end
					gui.Frame.Cam1.BackgroundColor3 = selected
				end
			elseif not IsSeated then
				for i,v in pairs(gui.Frame:GetChildren()) do
					v.Visible = false
					v.BackgroundColor3 = idle
					cam.CameraType = Enum.CameraType.Custom
				end
			end
			wait(.1)
		end)
		wait()
	end
end)

for i,v in pairs(gui.Frame:GetChildren()) do
	if v then
		v.MouseButton1Click:connect(function()
			if v.Visible then
				for a,b in pairs(gui.Frame:GetChildren()) do
					b.BackgroundColor3 = idle
				end
				local RealCam
				for a,b in pairs(guicams) do
					if b == v then
						RealCam = camparts[a]
					end
				end
				cam:Interpolate(RealCam.CFrame * CFrame.new(0, 0, 1),RealCam.CFrame,.5)
				v.BackgroundColor3 = selected
			end
		end)
	end
end
--!strict
--[=[
  @function map
  @within Dictionary

  @param dictionary {[K]: V} -- The dictionary to map.
  @param mapper (value: V, key: K, dictionary: {[K]: V}) -> (Y?, X?) -- The mapper function.
  @return {[X]: Y} -- The mapped dictionary.

  Maps the dictionary using the mapper function. The mapper function can
  return a value and a key. If the mapper function does not return a key,
  the original key will be used.

  ```lua
  local dictionary = { hello = 10, goodbye = 20 }

  local new = Map(dictionary, function(value, key)
    return value * 2, key .. "!"
  end) -- { ["hello!"] = 20, ["goodbye!"] = 40 }

  local new = Map(dictionary, function(value, key)
    return value * 10
  end) -- { hello = 100, goodbye = 200 }
  ```
]=]
local function map<K, V, X, Y>(
	dictionary: { [K]: V },
	mapper: (value: V, key: K, dictionary: { [K]: V }) -> (Y?, X?)
): { [X]: Y }
	local mapped = {}

	for key, value in pairs(dictionary) do
		local mappedValue, mappedKey = mapper(value, key, dictionary)
		mapped[mappedKey or key] = mappedValue
	end

	return mapped
end

return map
-- Public Constructors

function TextMaskClass.new(textFrame)
	local self = setmetatable({}, TextMaskClass)
	
	self._Maid = Lazy.Utilities.Maid.new()
	self._MaskType = MASKS.String
	self._MaxLength = 230000
	
	self.Frame = textFrame
	
	init(self)
	
	return self
end
--[[Engine]]
	--Torque Curve
	Tune.Horsepower		= 900		--	[TORQUE CURVE VISUAL]
	Tune.IdleRPM		= 600		--		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)
--[[local iceMesh = Instance.new("SpecialMesh", icePart)
iceMesh.Name = "IceMesh"
iceMesh.MeshType = "FileMesh"
iceMesh.MeshId = "http://www.roblox.com/asset/?id=1290033"
iceMesh.Scale = Vector3.new(0.675, 0.675, 0.675)]]



local function DisableMove()
	Humanoid.AutoRotate = false
	if(Humanoid.WalkSpeed~=0)then
		StoredValues = {Humanoid.WalkSpeed,Humanoid.JumpPower}
		Humanoid.WalkSpeed = 0
		Humanoid.JumpPower = 0
	end
    Humanoid:UnequipTools()
    PreventTools = character.ChildAdded:connect(function(Child)
	    wait()
	    if Child:IsA("Tool") and Child.Parent == character then
		    Humanoid:UnequipTools()
	    end
    end)
	DisableJump = Humanoid.Changed:connect(function(Property)
		if Property == "Jump" then
			Humanoid.Jump = false
		end
	end)
	Humanoid.PlatformStand = true
    --Humanoid:ChangeState(Enum.HumanoidStateType.Ragdoll)
end

local function EnableMove()
	Humanoid.AutoRotate = true
	Humanoid.WalkSpeed = StoredValues[1]
	Humanoid.JumpPower = StoredValues[2]
	for i, v in pairs({DisableJump, PreventTools}) do
		if v then
			v:disconnect()
		end
	end
	Humanoid.PlatformStand = false
    --Humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
end
--[=[
	Initializes the value as needed

	@param parent Instance
	@param instanceType string
	@param name string
	@param defaultValue any?
	@return Instance
]=]
function ValueBaseUtils.getOrCreateValue(parent, instanceType, name, defaultValue)
	assert(typeof(parent) == "Instance", "Bad argument 'parent'")
	assert(type(instanceType) == "string", "Bad argument 'instanceType'")
	assert(type(name) == "string", "Bad argument 'name'")

	local foundChild = parent:FindFirstChild(name)
	if foundChild then
		if not foundChild:IsA(instanceType) then
			warn(("[ValueBaseUtils.getOrCreateValue] - Value of type %q of name %q is of type %q in %s instead")
				:format(instanceType, name, foundChild.ClassName, foundChild:GetFullName()))
		end

		return foundChild
	else
		local newChild = Instance.new(instanceType)
		newChild.Name = name
		newChild.Value = defaultValue
		newChild.Parent = parent

		return newChild
	end
end
--global functions
ai.Move = function(loc, mustSee, humanoid)
	goalHumanoid = humanoid
	if goalPos then
		goalPos = loc
	else
		goalPos = loc
		Spawn(function()
			ai.State = "Tracking"
			local lastGoal
			local lastTime = time()
			while goalPos and ai.Humanoid do
				local gp = goalPos
				if pcall(function() return goalPos.X end) then
				elseif goalPos:IsA("BasePart") then
					gp = (ai.canSee(goalPos) or not mustSee) and goalPos.Position or nil
					lastTime = time()
				elseif goalPos:IsA("Model") then
					gp = nil
					for _, bodyPart in pairs(goalPos:GetChildren()) do
						if bodyPart:IsA("BasePart") and (ai.canSee(bodyPart) or not mustSee) then
							gp = goalPos:GetModelCFrame().p
							lastTime = time()
							break
						end
					end
				end
				lastGoal = gp and humanoid and gp + (gp - ai.Model.Torso.Position).unit * 10 or gp or lastGoal or ai.Model.Torso.Position
				if (goalHumanoid and goalHumanoid.Health <= 0) or (not goalHumanoid and (ai.Model.Torso.Position - lastGoal).magnitude < 3) or time() - lastTime > 3 then
					goalPos = nil
				else
					ai.Humanoid.Jump = objAhead(lastGoal)
					ai.Humanoid:MoveTo(lastGoal, workspace.Terrain)
					if goalHumanoid and ((ai.Model.Torso.Position - goalPos:GetModelCFrame().p) * Vector3.new(1,.5,1)).magnitude < 3 and time() - lastAttack > attackTime then
						attack(goalHumanoid)
					end
				end
				wait(.1)
			end
			if ai then
				ai.State = "Idle"
			end
		end)
	end
end