Pinkstack/roblox-luau-corpus-text huggingface dataset:
--local speed = script.Parent.Speed


local tweenInfo = TweenInfo.new(
	speed, -- Length (seconds)
	Enum.EasingStyle.Bounce,
	Enum.EasingDirection.Out,
	0, -- times repeared
	false, -- reverse
	delayed -- delay
)

goals[ 1 ] = spin.CFrame * CFrame.Angles( 0, math.rad( -30 ), 0 )
goals[ 2 ] = spin.CFrame * CFrame.Angles( 0, math.rad( -60 ), 0 )
goals[ 3 ] = spin.CFrame * CFrame.Angles( 0, math.rad( -90 ), 0 )
goals[ 4 ] = spin.CFrame * CFrame.Angles( 0, math.rad( -120 ), 0 )
goals[ 5 ] = spin.CFrame * CFrame.Angles( 0, math.rad( -150 ), 0 )
goals[ 6 ] = spin.CFrame * CFrame.Angles( 0, math.rad( -180 ), 0 )
goals[ 7 ] = spin.CFrame * CFrame.Angles( 0, math.rad( -210 ), 0 )
goals[ 8 ] = spin.CFrame * CFrame.Angles( 0, math.rad( -240 ), 0 )
goals[ 9 ] = spin.CFrame * CFrame.Angles( 0, math.rad( -270 ), 0 )
goals[ 10 ] = spin.CFrame * CFrame.Angles( 0, math.rad( -300 ), 0 )
goals[ 11 ] = spin.CFrame * CFrame.Angles( 0, math.rad( -330 ), 0 )
goals[ 12 ] = spin.CFrame

local i = 0
while spinning do
	i = i % #goals + 1

	local tween = TweenService:Create( spin, tweenInfo, { CFrame = goals[ i ] } )
	tween:Play()

	local state = tween.Completed:Wait()
	if state == Enum.PlaybackState.Cancelled then
		warn( 'Tween cancelled' )
		break
	end
end
--[[
	Anti-Spam
	For Click Detectors

	<Function> Wrap(<Function> FunctionToHook, <Int> OverrideNumberOfAttemptsAllowedBeforeCooldown)

	How to use;
		game:GetService("Workspace").INSTANCE.ClickDetector.MouseClick:Connect(Wrap(function()
			--// Code here
		end), OPTIONALCLICKSPAMPARAMETER)
	
		OR
	
		game:GetService("Workspace").INSTANCE.ClickDetector.MouseClick:Connect(Wrap(FUNCTION), OPTIONALCLICKSPAMPARAMETER)

	Phoenix
]]



local AntiSpam = {} -- Index: <instance> Player | Key: <int> Number of attempts
local DelayQueue = {} -- Index: <instance> Player | Key: <boolean> Delaying
local DefaultSpam = 15

coroutine.wrap(function()
	while true do
		wait(0.25)
		
		for Player, Attempts in pairs(AntiSpam) do
			if Attempts > 1 then
				AntiSpam[Player] = Attempts - 1
			end
		end
	end
end)()

return function(Function, OptionalCooldownParameter) --// Function that prevents spam for global controls eeeeyeeet
	local SpamStop

	if tonumber(OptionalCooldownParameter) ~= nil then
		SpamStop = tonumber(OptionalCooldownParameter)
	else
		SpamStop = DefaultSpam
	end
	
    local Delay = function(Player)
        DelayQueue[Player] = true
        
        wait(5)
        
        DelayQueue[Player] = false
        AntiSpam[Player] = 0
    end

	
    
    return function(Player)
        if AntiSpam[Player] == nil then
            AntiSpam[Player] = 0
        end
        
        if DelayQueue[Player] == nil then
            DelayQueue[Player] = false
        end

        if AntiSpam[Player] < SpamStop then
            AntiSpam[Player] = AntiSpam[Player] + 1
            Function(Player)
        elseif AntiSpam[Player] >= SpamStop and DelayQueue[Player] == false then
            Delay(Player)
        end
    end
end
-----------------------------------------------------------------------------------------------------------------


function onKeyDown(key)
if (key~=nil) then
key = key:lower()

if (key=="e")  then -- Toggle Patrol
if Holstered == true then
script.Parent.Parent.Humanoid.WalkSpeed = 16
GunUp()
elseif Holstered == false then
script.Parent.Parent.Humanoid.WalkSpeed = 11
GunDown()
end end end end
Tool.Equipped:connect(onEquippedLocal)
-- wrapper function



local function wrapper(child, addition)
	local this = newproxy(true);
	local mt = getmetatable(this);
	mt.__index = function(t, k) return addition[k] or child[k]; end;
	mt.__newindex = function(t, k, v) if addition[k] then addition[k] = v; else child[k] = v; end; end;
	mt.__call = function() return child; end;
	mt.__tostring = function(t) return tostring(child); end;
	mt.__metatable = "The metatable is locked.";
	return this;
end;
--[[
		___      _______                _     
	   / _ |____/ ___/ /  ___ ____ ___ (_)__ 
	  / __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<
	 /_/ |_|   \___/_//_/\_,_/___/___/_/___/
 						SecondLogic @ Inspare
]]



local car = script.Parent.Car.Value
local vl = script.Parent.Values

local strength = 350

local max = 4 --in sps

while wait() do
	if car.Body.Lights.BRAKE.Material ~= Enum.Material.Neon then
		if vl.Throttle.Value < 0.1 and vl.RPM.Value > 0 and vl.Velocity.Value.Magnitude < max and (math.abs(vl.Gear.Value) > 0) then
			car.Body.Creep.BV.MaxForce = Vector3.new(strength,0,strength)
		else
			car.Body.Creep.BV.MaxForce = Vector3.new(0,0,0)
		end
		car.Body.Creep.BV.Velocity = car.Body.Creep.CFrame.lookVector*(8*(math.min(vl.Gear.Value,1)))
	else
		car.Body.Creep.BV.Velocity = Vector3.new(0,0,0)
	end
end
-- no touchy


local path
local waypoint
local oldpoints
local isWandering = 0

if canWander then
	spawn(function()
		while isWandering == 0 do
			isWandering = 1
			local desgx, desgz = hroot.Position.x + math.random(-WanderX, WanderX), hroot.Position.z + math.random(-WanderZ, WanderZ)
			human:MoveTo( Vector3.new(desgx, 0, desgz) )
			wait(math.random(4, 6))
			isWandering = 0
		end
	end)
end

while wait() do
	local enemytorso = GetTorso(hroot.Position)	
	if enemytorso ~= nil then -- if player detected
		isWandering = 1
		local function checkw(t)
			local ci = 3
			if ci > #t then
				ci = 3
			end
			if t[ci] == nil and ci < #t then
				repeat
					ci = ci + 1
					wait()
				until t[ci] ~= nil
				return Vector3.new(1, 0, 0) + t[ci]
			else
				ci = 3
				return t[ci]
			end
		end

		path = pfs:FindPathAsync(hroot.Position, enemytorso.Position)
		waypoint = path:GetWaypoints()
		oldpoints = waypoint
		local connection;

		local direct = Vector3.FromNormalId(Enum.NormalId.Front)
		local ncf = hroot.CFrame * CFrame.new(direct)
		direct = ncf.p.unit
		local rootr = Ray.new(hroot.Position, direct)
		local phit, ppos = game.Workspace:FindPartOnRay(rootr, hroot)

		if path and waypoint or checkw(waypoint) then
			if checkw(waypoint) ~= nil and checkw(waypoint).Action == Enum.PathWaypointAction.Walk then
				human:MoveTo( checkw(waypoint).Position )
				human.Jump = false
			end

			if checkw(waypoint) ~= nil and checkw(waypoint).Action == Enum.PathWaypointAction.Jump then
				human.Jump = true
				connection = human.Changed:connect(function()
					human.Jump = true
				end)
				human:MoveTo( checkw(waypoint).Position )
			else
				human.Jump = false
			end

			hroot.Touched:connect(function(p)
				local bodypartnames = GetPlayersBodyParts(enemytorso)
				if p:IsA'Part' and not (p.Name == bodypartnames) and phit and phit.Name ~= bodypartnames and phit:IsA'Part' and rootr:Distance(phit.Position) < 5 then
					connection = human.Changed:connect(function()
						human.Jump = true
					end)
				else
					human.Jump = false
				end
			end)

			if connection then
				connection:Disconnect()
			end

		else
			for i = 3, #oldpoints do
				human:MoveTo( oldpoints[i].Position )	
			end
		end
	elseif enemytorso == nil and canWander then -- if player not detected
		isWandering = 0
		path = nil
		waypoint = nil
		human.MoveToFinished:Wait()
	end
end
--!strict


local Packages = script.Parent.Parent
local LuauPolyfill = require(Packages.LuauPolyfill)
type Error = LuauPolyfill.Error
type Object = LuauPolyfill.Object
type Array<T> = LuauPolyfill.Array<T>
local Error = LuauPolyfill.Error
local inspect = LuauPolyfill.util.inspect

local DIVIDER = "\n------ Error caught by React ------\n"
--// Functions


function Forward()
	Storage.Sound:FireServer(runSound, true)
	Storage.Sound:FireServer(idleSound, false)
	
	while true do
		rst:Wait()
		if ForwardKeyDown then
			if speed < maxSpeed then
				speed = speed + 0.5
			elseif speed > maxSpeed then
				speed = maxSpeed
			end
			
			local lv = seat.CFrame.lookVector
		
			local maxVelo = ((2*lv)*maxSpeed)
			local newVelo = ((2*lv)*speed)

			Storage.UpdateBV:FireServer(newVelo, BV)
		end
		
		if not ForwardKeyDown and not BackwardKeyDown then
			speed = speed - 1
			
			local lv = seat.CFrame.lookVector
			
			local newVelo = ((2*lv)*speed)
			
			Storage.UpdateBV:FireServer(newVelo, BV)
			
			if speed <= 0 then
				speed = 0
				
				local newVelo = ((2*lv)*0)
				Storage.UpdateBV:FireServer(newVelo, BV)
				
				Storage.Sound:FireServer(idleSound, true)
				Storage.Sound:FireServer(runSound, false)
				break
			end
			
			if BackwardKeyDown and not ForwardKeyDown then
				break
			end
		end
	end
end

function Backwards()	
	Storage.Sound:FireServer(runSound, true)
	Storage.Sound:FireServer(idleSound, false)
	
	while true do
		rst:Wait()
		if BackwardKeyDown then
			if speed > -maxSpeed then
				speed = speed - 0.5
			elseif speed < -maxSpeed then
				speed = -maxSpeed
			end
			
			local lv = seat.CFrame.lookVector
			local newVelo = ((2*lv)*speed)
			
			Storage.UpdateBV:FireServer(newVelo, BV)
		end
		
		if not BackwardKeyDown and not ForwardKeyDown then
			speed = speed + 1
			
			local lv = seat.CFrame.lookVector

			local newVelo = ((2*lv)*speed)

			Storage.UpdateBV:FireServer(newVelo, BV)
			
			
			if speed <= 0 then
				speed = 0
				
				local newVelo = ((2*lv)*0)
				Storage.UpdateBV:FireServer(newVelo, BV)
				
				Storage.Sound:FireServer(idleSound, true)
				Storage.Sound:FireServer(runSound, false)
				break
			end
		end
		
		if not BackwardKeyDown and ForwardKeyDown then
			break
		end
	end
end

function turnRight()
	while RightTurnKeyDown do
		wait()
		
		local newAV
		
		if ForwardKeyDown or BackwardKeyDown then
			newAV = Vector3.new(0,-0.5,0)
		else
			newAV = Vector3.new(0,-0.4,0)
		end
		
		Storage.UpdateAV:FireServer(newAV, BAV)
		
		if not RightTurnKeyDown then
			local newAV = Vector3.new(0,0,0)
			Storage.UpdateAV:FireServer(newAV, BAV)
		end
	end
end

function turnLeft()
	while LeftTurnKeyDown do
		wait()
		
		local newAV
		
		if ForwardKeyDown or BackwardKeyDown then
			newAV = Vector3.new(0,0.5,0)
		else
			newAV = Vector3.new(0,0.4,0)
		end
		
		Storage.UpdateAV:FireServer(newAV, BAV)
		
		if not LeftTurnKeyDown then
			local newAV = Vector3.new(0,0,0)
			Storage.UpdateAV:FireServer(newAV, BAV)
		end
	end
end

function EndControl(bool)
	Storage.Sound:FireServer(runSound, false)
	Storage.Sound:FireServer(idleSound, false)
	
	Equipped = false
	Storage.Stop:FireServer(BV, BAV)
	cam.CameraType = Enum.CameraType.Custom
	
	script:Destroy()
end

function flipTank()
	Storage.Flip:FireServer(seat, BG)	
end
--[[
This door, the first on ROBLOX of its kind, was created by Mark Otaris (JulienDethurens).

It opens when it is touched by someone whose rank in a certain group is higher or equal than/to a certain rank number.

The group's id can be specified in the GroupId value in the configuration folder contained in the door.
The rank id (from 1 to 255) can be specified in the RankId value in the configuration folder.
]]



local config = script.Parent.Configuration

script.Parent.Touched:connect(function(part)
	if part.Parent and Game:GetService('Players'):GetPlayerFromCharacter(part.Parent) then
		local player = Game:GetService('Players'):GetPlayerFromCharacter(part.Parent)
		if player:GetRankInGroup(config.GroupId.Value) >= config.RankId.Value then
			script.Parent.Transparency = 1
			script.Parent.CanCollide = false
			wait(0.5)
			script.Parent.Transparency = 1
			script.Parent.CanCollide = true
		end
	end
end)
-- Every valid configuration value should be non-nil in this table.


local defaultConfig = {
	-- Enables asserts for internal Roact APIs. Useful for debugging Roact itself.
	["internalTypeChecks"] = false,
	-- Enables stricter type asserts for Roact's public API.
	["typeChecks"] = false,
	-- Enables storage of `debug.traceback()` values on elements for debugging.
	["elementTracing"] = false,
	-- Enables validation of component props in stateful components.
	["propValidation"] = false,

	-- Temporary config for enabling a bug fix for processing events based on updates to child instances
	-- outside of the standard lifecycle.
	["tempFixUpdateChildrenReEntrancy"] = false,
}
--[[
	CLIMAXIMUS's Saving Script.
	Equipped with the best of scripting.
	( Must be put in ServerScriptService(Reccomended!) or workspace. )
]]

--

gameStats = { --[[ <-- Player can save his stats on command ]]
	["DoChat?"] = {
		["DoIt?"] = true;
		["Keywords"] = {
			"/save"; "/ save"; 
			":save"; ": save"
		}
	}; 
	["DoMessages?"] = true; --[[ <-- Reminder of saving/loading ]]
	["IsAnObby?"] = false; --[[ <-- Respawns the character to fix loading ]]
	saveType = {
		["Normal?"] = true; --[[ <-- Set to false if other ]]
		["SavingList?"] = { --[[ <-- Specific wanted admins ]]
			["DoIt?"] = false;
			theList = {
				"Name1";
				"Name2";
				"Name3"
			}
		};
		["BestFriends?"] = false; --[[ <-- Best friends of your's only. ]]
		["Friends?"] = false; --[[ <-- Friends of your's only. ]]
		["OwnerOnly?"] = false; --[[ <-- Only you have saving stats ]]
		["Gamepass?"] = { --[[ <-- Needs a gamepass to save ]]
			["DoIt?"] = false;
			["GamepassId"] = 000000
		};
		["Asset/Item?"] = { --[[ Such as a T-Shirt ]]
			["DoIt?"] = false;
			["AssetId"] = 000000
		}
	};
}
--[[

INSTRUCTIONS

Every node has a priority value. It is the number that is displayed on the top right corner of the node. This is what is used to select which node the condition unlocks.

To select a node with a condition, you must return a number equal to the target node's priority. For example:

Let's say I had two prompt nodes both with different priorities. One has a priority of 1, and the other a priority of 2. Now let's say I wanted the condition to unlock one or the other randomly.
In that case, I would simply return math.random(1,2) inside the Module.Run() function.

Note: Condition nodes connect from the primary output to inputs.

]]



function Condition.Run()
	return 1 --Selects a node with a priority of 1
end

return Condition
-- networking : (table) our http handler for making POST requests
-- trackingId : (string)
-- clientId : (string)
-- userId : (string)
-- eventArgs : (table) event specific arguments


local function sendReport(networking, trackingId, clientId, userId, eventArgs)
	local url = "https://www.google-analytics.com/collect"
	--local url = "https://www.google-analytics.com/debug/collect"

	-- sanitize some input
	local function exists(variableName, value)
		local wasFound = (value ~= nil)
		if not wasFound then
			warn("Google Analytics cannot send reports without a " .. variableName)
		end
		return wasFound
	end
	if not (exists("tracking ID", trackingId) and
		exists("userId", userId) and
		exists("clientId", clientId) and
		exists("event arguments", eventArgs)) then
		return
	end

	local params = {}
	for k,v in pairs(eventArgs) do
		table.insert(params, string.format("%s=%s",k,v))
	end

	-- add some required arguments
	table.insert(params, string.format("v=%d", VERSION))		-- version
	table.insert(params, string.format("tid=%s", trackingId))	-- property Id
	table.insert(params, string.format("ds=%s", PLACE_ID))		-- data source
	table.insert(params, string.format("cid=%s", clientId))		-- guid to identify this specific client
	table.insert(params, string.format("uid=%s", userId))		-- unique, anonymous user id. This should be last


	-- construct the post body data
	local paramString = table.concat(params, "&")

	-- report the event to GA
	return networking:POST(url, paramString)
end
--Jamie









debounce = true
function onTouched(hit)
	if (hit.Parent:findFirstChild("Humanoid") ~= nil and debounce == true) then
		script.Parent.Refill:Play()
		hit.Parent.Saude.Kit.Parent.Kit.Aspirina.Value = hit.Parent.Saude.Kit.Parent.Kit.Aspirina.MaxValue --Painkillers
		hit.Parent.Saude.Kit.Parent.Kit.Bandagem.Value = hit.Parent.Saude.Kit.Parent.Kit.Bandagem.MaxValue --Field Dressing/Bandages
		hit.Parent.Saude.Kit.Parent.Kit.Energetico.Value = hit.Parent.Saude.Kit.Parent.Kit.Energetico.MaxValue --Energy Drink
		hit.Parent.Saude.Kit.Parent.Kit.Epinefrina.Value = hit.Parent.Saude.Kit.Parent.Kit.Epinefrina.MaxValue --Epinephrine
		hit.Parent.Saude.Kit.Parent.Kit.Morfina.Value = hit.Parent.Saude.Kit.Parent.Kit.Morfina.MaxValue --Morphine
		hit.Parent.Saude.Kit.Parent.Kit.SacoDeSangue.Value = 15 --Blood Bag
		hit.Parent.Saude.Kit.Parent.Kit.Splint.Value = hit.Parent.Saude.Kit.Parent.Kit.Splint.MaxValue --Splint (fixes injured status)
		hit.Parent.Saude.Kit.Parent.Kit.skit.Value = 20
		hit.Parent.Saude.Kit.Parent.Kit.bvm.Value = 1
		hit.Parent.Saude.Kit.Parent.Kit.etube.Value =  2
		hit.Parent.Saude.Kit.Parent.Kit.nrb.Value = 2
		hit.Parent.Saude.Kit.Parent.Kit.Tourniquet.Value =  5
		debounce = false
		print("Refill Cooling Down")
		wait(5)
        debounce = true
        print("Refill Cooldown Over")
	end
end
script.Parent.Touched:connect(onTouched)
-- Repeat every 3 seconds


while wait(3) do
	-- Create a new explosion object with the 'Example' template
	local NewExplosion = Explosion.new("Example")
	
	-- Set the explosion lifetime to 3 seconds so that the sound (3.75s long) can finish playing.
	NewExplosion.Lifetime = 4
	
	-- Set the EffectFunction to the one defined above
	NewExplosion:SetEffectFunction(CustomEffectFunction)
	
	-- Set the explosion's position
	NewExplosion:SetPosition(Vector3.new(25, 5, 0))
	
	-- EffectFunction will be called after this.
	NewExplosion:SetParent(workspace)
end
--// Handling Settings		


	Firerate = 60 / 720; -- 60 = 1 Minute, 700 = Rounds per that 60 seconds. DO NOT TOUCH THE 60!
	
	FireMode = 2; -- 1 = Semi, 2 = Auto, 3 = Burst, 4 = Bolt Action, 5 = Shot, 6 = Explosive
---------------------------------------------------



This = script.Parent
Lift = This.Parent.Parent.Parent.Parent
Floor = Lift:WaitForChild("Floor")
Direction = Lift:WaitForChild("Direction")
Motor = Lift:WaitForChild("MotorMode")

CustomLabel = require(Lift.CustomLabel)
Characters = require(script.Characters)

CustomText = CustomLabel["CUSTOMFLOORLABEL"]

Lift:WaitForChild("Floor").Changed:connect(function(floor)
  --custom indicator code--
  ChangeFloor(tostring(floor))
end)

function ChangeFloor(SF)
	if CustomText[tonumber(SF)] then
		SF = CustomText[tonumber(SF)]
	end
	This.Floor.Text = SF
end
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------


if guntype == 1 then
local torso = model.Parent:FindFirstChild("Torso")
if torso ~= nil then
if weldmode == 1 then--barrel pointing upper-right
local w = Instance.new("Weld")
w.Part0 = torso
w.Parent = w.Part0
w.Part1 = handle
w.C1 = CFrame.new(distance *-1, 0.25 +y, -0.75 +x *-1) * CFrame.fromEulerAnglesXYZ(math.rad(rotation *-1), (math.pi / 2), 0)
elseif weldmode == 2 then--barrel pointing upper-left
local w = Instance.new("Weld")
w.Part0 = torso
w.Parent = w.Part0
w.Part1 = handle
w.C1 = CFrame.new(distance, 0.25 +y, -0.75 +x *-1) * CFrame.fromEulerAnglesXYZ(math.rad(rotation *-1), (math.pi / 2 ) *-1, 0)
elseif weldmode == 3 then--barrel pointing upside-right
local w = Instance.new("Weld")
w.Part0 = torso
w.Parent = w.Part0
w.Part1 = handle
w.C1 = CFrame.new(distance *-1, 0.25+y, -0.75 +x *-1) * CFrame.fromEulerAnglesXYZ(math.rad(rotation), (math.pi / 2), 0)
elseif weldmode == 4 then--barrel pointing upside-left
local w = Instance.new("Weld")
w.Part0 = torso
w.Parent = w.Part0
w.Part1 = handle
w.C1 = CFrame.new(distance, 0.25+y, -0.75 +x *-1) * CFrame.fromEulerAnglesXYZ(math.rad(rotation), (math.pi / 2 +rotation) *-1, 0)
end
end
-- RANK, RANK NAMES & SPECIFIC USERS


Ranks = {
	{5,	"Game Creator",		};
	{4,	"Tester",	{"",0},	};
	{3,	"Best Friends",		{"",0},	};
	{2,	"Friends",			{"",0},	};
	{1,	"VIP",			{"",0},	};
	{0,	"NonAdmin",		};
};
--Rescripted by Luckymaxer



Part = script.Parent

Debris = game:GetService("Debris")

Sounds = {
	GlassBreak = Part:WaitForChild("GlassBreak")
}

function Touched(Part)
	local PartTouched
	PartTouched = Part.Touched:connect(function(Hit)
		if not Hit or not Hit.Parent then
			return
		end
		Sounds.GlassBreak:Play()
		if PartTouched then
			PartTouched:disconnect()
		end
	end)
end

Touched(Part)

Debris:AddItem(Part, 30)
--Compares two tables, and produces a new table containing the differences


function module:MakeDeltaTable(oldTable, newTable)
    
    if (oldTable == nil) then
        return self:DeepCopy(newTable)
    end
    
    local deltaTable = {}
    local changes = 0
    for var, data in pairs(newTable) do
        if oldTable[var] == nil then
            deltaTable[var] = data
        else
            if type(newTable[var]) == "table" then
                --its a table, recurse
                local newtable, num = module:MakeDeltaTable(oldTable[var], newTable[var])
                if num > 0 then
                    changes = changes + 1
                    deltaTable[var] = newtable
                end
            else
                local a = newTable[var]
                local b = oldTable[var]
                if a ~= b then
                    changes = changes + 1
                    deltaTable[var] = a
                end
            end
        end
    end
    --Check for deletions
    for var, _ in pairs(oldTable) do
        if newTable[var] == nil then
            if deltaTable.__deletions == nil then
                deltaTable.__deletions = {}
            end
            table.insert(deltaTable.__deletions, var)
        end
    end

    return deltaTable, changes
end
----- Initialize -----



if IsStudio == true then
	IsLiveCheckActive = true
	coroutine.wrap(function()
		local status, message = pcall(function()
			-- This will error if current instance has no Studio API access:
			DataStoreService:GetDataStore("____PS"):SetAsync("____PS", os.time())
		end)
		local no_internet_access = status == false and string.find(message, "ConnectFail", 1, true) ~= nil
		if no_internet_access == true then
			warn("[ProfileService]: No internet access - check your network connection")
		end
		if status == false and
			(string.find(message, "403", 1, true) ~= nil or -- Cannot write to DataStore from studio if API access is not enabled
				string.find(message, "must publish", 1, true) ~= nil or -- Game must be published to access live keys
				no_internet_access == true) then -- No internet access

			UseMockDataStore = true
			ProfileService._use_mock_data_store = true
		else
		end
		IsLiveCheckActive = false
	end)()
end
--Sphere to box collision


function collision_module.SqDistPointAABB(point, box)
	local sq_dist = 0

	--X axis check
	local v = point.X
	if v < box.min.X then
		sq_dist += (box.min.X - v) * (box.min.X - v)
	end
	if v > box.max.X then
		sq_dist += (v - box.max.X) * (v - box.max.X)
	end

	--Y axis check
	local v = point.Y
	if v < box.min.Y then
		sq_dist += (box.min.Y - v) * (box.min.Y - v)
	end
	if v > box.max.Y then
		sq_dist += (v - box.max.Y) * (v - box.max.Y)
	end

	--Z axis check
	local v = point.Z
	if v < box.min.Z then
		sq_dist += (box.min.Z - v) * (box.min.Z - v)
	end
	if v > box.max.Z then
		sq_dist += (v - box.max.Z) * (v - box.max.Z)
	end

	return sq_dist
end

function collision_module.TestSphereAABB(sphere, box)
	local sq_dist = collision_module.SqDistPointAABB(sphere.center, box)
	return sq_dist <= (sphere.radius ^ 2)
end

function collision_module.TestSphereRotatedBox(sphere, rotated_box)
	local sq_dist = collision_module.SqDistPointAABB(rotated_box.cframe:inverse() * sphere.center, {min = rotated_box.size / -2, max = rotated_box.size / 2})
	return sq_dist <= (sphere.radius ^ 2)
end

return collision_module