Pinkstack/roblox-luau-corpus-text huggingface dataset:
--Char.Humanoid.BreakJointsOnDeath = false



if configuracao.EnableRagdoll == true then
	Char.Humanoid.Died:Connect(function()
		Ragdoll(Char)
	end)
end


while configuracao.EnableMedSys do
wait()
	if Sangrando.Value == true then
		if PastasStan.Tourniquet.Value == false then
			Sang.Value = (Sang.Value - (MLs.Value/60))
			UltimoSang = Sang.Value
			MLs.Value = MLs.Value + 0.025
		end
	end

	if PastasStan.Tourniquet.Value == true then
		Dor.Value = Dor.Value + 0.1
	end

	if (human.Health - ultimavida < 0) then
		Sang.Value = Sang.Value + (human.Health - ultimavida)*((configuracao.BloodMult)*(configuracao.BloodMult)*(configuracao.BloodMult))
		UltimoSang = Sang.Value
	end

	if (human.Health - ultimavida < 0) then
		Dor.Value = math.ceil(Dor.Value + (human.Health - ultimavida)*(-configuracao.PainMult))
		--Energia.Value = math.ceil(Energia.Value + (human.Health - ultimavida)*(5))
	end	

	if (human.Health - ultimavida < 0) --[[and (Sangrando.Value == true)]] then
		MLs.Value = MLs.Value + ((ultimavida - human.Health)* (configuracao.BloodMult))
	end

	if script.Parent.Parent.Humanoid.Health < ultimavida -(configuracao.BleedDamage) then
			Sangrando.Value = true
		if script.Parent.Parent.Humanoid.Health < ultimavida -(configuracao.InjuredDamage) then
			Ferido.Value = true
			if script.Parent.Parent.Humanoid.Health < ultimavida -(configuracao.KODamage) then
				Caido.Value = true
			end
		end	
	end	
	
	if human.Health >= human.MaxHealth and Sangrando.Value == false then
		Sang.Value = Sang.Value + 0.5	
		Dor.Value = Dor.Value - 0.025
		MLs.Value = MLs.Value - 0.025		
			
	end
		
	if Sang.Value <= 0 then
		human.Health = 0
	end

	ultimavida = script.Parent.Parent.Humanoid.Health


	spawn(function(timer)
			if Sang.Value >= 3500 and Dor.Value < 200 and Caido.Value == true and debounce == false then
				debounce = true
				wait(60)
				Caido.Value = false
				debounce = false
			end	
		end)

end




 -- Quero um pouco de credito,plox :P --
     --  FEITO 100% POR SCORPION --
		-- Oficial Release 1.5 --
-------- OMG HAX



r = game:service("RunService")


local damage = 15


local slash_damage = 15


sword = script.Parent.Handle
Tool = script.Parent


local SlashSound = Instance.new("Sound")
SlashSound.SoundId = "rbxasset://sounds\\swordslash.wav"
SlashSound.Parent = sword
SlashSound.Volume = 1


local UnsheathSound = Instance.new("Sound")
UnsheathSound.SoundId = "http://www.roblox.com/asset/?id=16425587"
UnsheathSound.Parent = sword
UnsheathSound.Volume = 1


function blow(hit)
	local humanoid = hit.Parent:findFirstChild("Humanoid")
	local vCharacter = Tool.Parent
	local vPlayer = game.Players:playerFromCharacter(vCharacter)
	local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
	if humanoid~=nil and humanoid ~= hum and hum ~= nil then
		-- final check, make sure sword is in-hand

		local right_arm = vCharacter:FindFirstChild("Right Arm")
		if (right_arm ~= nil) then
			local joint = right_arm:FindFirstChild("RightGrip")
			if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
				tagHumanoid(humanoid, vPlayer)
				humanoid:TakeDamage(damage)
				wait(1)
				untagHumanoid(humanoid)
			end
		end


	end
end


function tagHumanoid(humanoid, player)
	local creator_tag = Instance.new("ObjectValue")
	creator_tag.Value = player
	creator_tag.Name = "creator"
	creator_tag.Parent = humanoid
end

function untagHumanoid(humanoid)
	if humanoid ~= nil then
		local tag = humanoid:findFirstChild("creator")
		if tag ~= nil then
			tag.Parent = nil
		end
	end
end


function attack()
	damage = slash_damage
	SlashSound:play()
	local anim = Instance.new("StringValue")
	anim.Name = "toolanim"
	anim.Value = "Slash"
	anim.Parent = Tool
end


function swordUp()
	Tool.GripForward = Vector3.new(-1,0,0)
	Tool.GripRight = Vector3.new(0,1,0)
	Tool.GripUp = Vector3.new(0,0,1)
end

function swordOut()
	Tool.GripForward = Vector3.new(0,0,1)
	Tool.GripRight = Vector3.new(0,-1,0)
	Tool.GripUp = Vector3.new(-1,0,0)
end



Tool.Enabled = true

function onActivated()

	if not Tool.Enabled then
		return
	end

	Tool.Enabled = false

	local character = Tool.Parent;
	local humanoid = character.Humanoid
	if humanoid == nil then
		print("Humanoid not found")
		return 
	end

	

	attack()

	wait(1)

	Tool.Enabled = true
end


function onEquipped()
	UnsheathSound:play()
end


script.Parent.Activated:connect(onActivated)
script.Parent.Equipped:connect(onEquipped)


connection = sword.Touched:connect(blow)
--[=[
	Provides utility functions to work with attributes in Roblox
	@class AttributeUtils
]=]



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

local RunService = game:GetService("RunService")

local Maid = require("Maid")
local Promise = require("Promise")
local CancelToken = require("CancelToken")

local DEFAULT_PREDICATE = function(value)
	return value ~= nil
end

local AttributeUtils = {}

local VALID_ATTRIBUTE_TYPES = {
	["nil"] = true;
	["string"] = true;
	["boolean"] = true;
	["number"] = true;
	["UDim"] = true;
	["UDim2"] = true;
	["BrickColor"] = true;
	["CFrame"] = true;
	["Color3"] = true;
	["Vector2"] = true;
	["Vector3"] = true;
	["NumberSequence"] = true;
	["ColorSequence"] = true;
	["IntValue"] = true;
	["NumberRange"] = true;
	["Rect"] = true;
	["Font"] = true;
}
--[[
	Package link auto-generated by Rotriever
]]


local PackageIndex = script.Parent.Parent.Parent._Index

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

export type ReactEmpty = Package.ReactEmpty
export type ReactFragment = Package.ReactFragment
export type ReactNodeList = Package.ReactNodeList
export type ReactProviderType<T> = Package.ReactProviderType<T> 
export type ReactConsumer<T> = Package.ReactConsumer<T> 
export type ReactProvider<T> = Package.ReactProvider<T> 
export type ReactContext<T> = Package.ReactContext<T> 
export type ReactPortal = Package.ReactPortal
export type RefObject = Package.RefObject
export type EventPriority = Package.EventPriority
export type ReactFundamentalComponentInstance<C, H> =
Package.ReactFundamentalComponentInstance<C, H> 
export type ReactFundamentalImpl<C, H> = Package.ReactFundamentalImpl<C, H> 
export type ReactFundamentalComponent<C, H> = Package.ReactFundamentalComponent<C, H> 
export type ReactScope = Package.ReactScope
export type ReactScopeQuery = Package.ReactScopeQuery
export type ReactScopeInstance = Package.ReactScopeInstance
export type ReactBinding<T> = Package.ReactBinding<T> 
export type ReactBindingUpdater<T> = Package.ReactBindingUpdater<T> 
export type MutableSourceVersion = Package.MutableSourceVersion
export type MutableSourceGetSnapshotFn<Source, Snapshot> =
Package.MutableSourceGetSnapshotFn<Source, Snapshot> 
export type MutableSourceSubscribeFn<Source, Snapshot> = Package.MutableSourceSubscribeFn<Source, Snapshot> 
export type MutableSourceGetVersionFn = Package.MutableSourceGetVersionFn
export type MutableSource<Source> = Package.MutableSource<Source> 
export type Wakeable = Package.Wakeable
export type Thenable<R> = Package.Thenable<R> 
export type Source = Package.Source
export type ReactElement<P = Object, T = any> = Package.ReactElement<P , T > 
export type OpaqueIDType = Package.OpaqueIDType
export type Dispatcher = Package.Dispatcher
export type React_Ref<ElementType> = Package.React_Ref<ElementType> 
export type React_Context<T> = Package.React_Context<T> 
export type React_AbstractComponent<Config, Instance> = Package.React_AbstractComponent<Config, Instance> 
export type React_ComponentType<Config> = Package.React_ComponentType<Config> 
export type React_PureComponent<Props, State = nil> = Package.React_PureComponent<Props, State > 
export type React_Component<Props, State> = Package.React_Component<Props, State> 
export type React_ElementProps<ElementType> = Package.React_ElementProps<ElementType> 
export type React_StatelessFunctionalComponent<Props> =
Package.React_StatelessFunctionalComponent<Props> 
export type React_Node = Package.React_Node
export type React_Element<ElementType> = Package.React_Element<ElementType> 
export type React_ElementType = Package.React_ElementType
export type React_ElementConfig<C> = Package.React_ElementConfig<C> 
export type React_ElementRef<C> = Package.React_ElementRef<C> 
export type React_Portal = Package.React_Portal
export type React_Key = Package.React_Key


return Package
--[[[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
		ToggleTCS				= Enum.KeyCode.T					,
		ToggleABS				= Enum.KeyCode.Y					,
		ToggleTransMode			= Enum.KeyCode.M					,
		ToggleMouseDrive		= Enum.KeyCode.F1					,
		
		--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.ButtonL1				,
		ContlrToggleTMode		= Enum.KeyCode.DPadUp				,
		ContlrToggleTCS			= Enum.KeyCode.DPadDown				,
		ContlrToggleABS			= Enum.KeyCode.DPadRight			,
	}
-- Leaderboard table


local leaderboard = {}
local _table = false

function leaderboard.new()
	local self = script.Parent:WaitForChild("Table")
	
	function leaderboard.AddRow(player)
		-- Only add row for player if it does not exist
		if self:FindFirstChild(player.Name) then return end

		local row = Instance.new("Frame")
		row.Name = player.Name
		row.Size = UDim2.new(1, 0, 0, 28)
		row.BackgroundColor3 = Color3.new(255/255, 179/255, 71/255)
		row.BorderSizePixel = 0
		row.Parent = self
		
		local column1 = Instance.new("TextLabel")
		column1.Name = "Username"
		column1.Size = UDim2.new(0.6, 0, 0.8, 0)
		column1.Position = UDim2.new(0.05, 0,0.1, 0)
		column1.BackgroundTransparency = 1
		column1.TextColor3 = Color3.new(1, 1, 1)
		column1.TextScaled = true
		column1.TextXAlignment = Enum.TextXAlignment.Left
		column1.TextYAlignment = Enum.TextYAlignment.Center
		column1.Text = player.Name
		column1.Parent = row
		
		local column2 = Instance.new("TextLabel")
		column2.Name = "Points"
		column2.Size = UDim2.new(0.25, 0, 0.8, 0)
		column2.Position = UDim2.new(0.7, 0,0.1, 0)
		column2.BackgroundTransparency = 1
		column2.TextColor3 = Color3.new(1, 1, 1)
		column2.TextScaled = true
		column2.TextXAlignment = Enum.TextXAlignment.Right
		column2.TextYAlignment = Enum.TextYAlignment.Center
		column2.Text = 0
		column2.Parent = row
		
		-- Listen for point value changes and update leaderboard
		local leaderstats = player:WaitForChild("CustomLeaderstats")
		local points = leaderstats:WaitForChild("Points")
		points.Changed:Connect(function()
			column2.Text = points.Value
			column2.LayoutOrder = points.Value
		end)
	end

	function leaderboard.DeleteRow(player)
		local rowToDelete = self:FindFirstChild(player.Name)
		if rowToDelete then
			rowToDelete:Destroy()
			return true
		else
			return false
		end
	end
	
	function leaderboard.Populate()
		local playerList = Players:GetChildren()
		for i, player in pairs (playerList) do
			leaderboard.AddRow(player)				
		end
	end
		
	function leaderboard.Resize(child)
		-- Size of table should be # of children - 2 to account to UIListLayout and this script
		local size = #self:GetChildren() - 2
		self.CanvasSize = UDim2.new(0,0,size,0)
	end
	
	-- Signals
	Players.PlayerAdded:Connect(leaderboard.AddRow)
	Players.PlayerRemoving:Connect(leaderboard.DeleteRow)

	self.ChildAdded:Connect(leaderboard.Resize)
	self.ChildRemoved:Connect(leaderboard.Resize)
	
	return leaderboard
end
-- @moduledescription Manage all the player, if they are ready or not


local module = {}
local System = require(game.ReplicatedStorage.System)

module.OnReady = System.Signal.new()

function module.Init()
	
	System.Remotes.ConnectEvent("Ready", function(plr)
		print(plr, "is ready!")
		
		local Player = System.Player.Get(plr)
		Player.Ready = true
		System.Entity.ReplicateToNewPlayer(plr)
		Player:OnDeath(true)
		
	end)
	
	game.Players.PlayerRemoving:Connect(function(p)
		local plr = System.Player.Get(p)
		if not plr then return end
		
		print(plr:ToString(), "Left")
		plr:Destroy()
	end)
end

return module
--[[
	Calls a callback on `done` with specific arguments.
]]


function Promise.prototype:doneCall(callback, ...)
	assert(type(callback) == "function", string.format(ERROR_NON_FUNCTION, "Promise:doneCall"))
	local length, values = pack(...)
	return self:_finally(debug.traceback(nil, 2), function()
		return callback(unpack(values, 1, length))
	end, true)
end
Promise.prototype.DoneCall = Promise.prototype.doneCall
-------- OMG HAX



r = game:service("RunService")


Tool = script.Parent

local equalizingForce = 236 / 1.2 -- amount of force required to levitate a mass
local gravity = .9999999999999999 -- things float at > 1

local ghostEffect = nil
local massCon1 = nil
local massCon2 = nil

function recursiveGetLift(node)
	local m = 0
	local c = node:GetChildren()
	for i=1,#c do
		if c[i].className == "Part" then
			if c[i].Name == "Handle" then
				m = m + (c[i]:GetMass() * equalizingForce * 1) -- hack that makes hats weightless, so different hats don't change your jump height
			else
				m = m + (c[i]:GetMass() * equalizingForce * gravity)
			end
		end
		m = m + recursiveGetLift(c[i])
	end
	return m
end


function onMassChanged(child, char)
	print("Mass changed:" .. child.Name .. "    " .. char.Name)
	if (ghostEffect ~= nil) then
		ghostEffect.force = Vector3.new(0, recursiveGetLift(char) ,0)
	end
end



function UpdateGhostState(isUnequipping)

	if isUnequipping == true then
		ghostEffect:Remove()
		ghostEffect = nil
		massCon1:disconnect()
		massCon2:disconnect()
	else
		if ghostEffect == nil then
			local char = Tool.Parent
			if char == nil then return end
			ghostEffect = Instance.new("BodyForce")
			ghostEffect.Name = "GravityCoilEffect"
			ghostEffect.force = Vector3.new(0, recursiveGetLift(char) ,0)
			ghostEffect.Parent = char.Head
			ghostChar = char
			massCon1 = char.ChildAdded:connect(function(child)  onMassChanged(child, char) end)
			massCon2 = char.ChildRemoved:connect(function(child)  onMassChanged(child, char) end)
		end
	end


end



function onEquipped()
	Tool.Handle.PopSound:Play()
	UpdateGhostState(false)
end

function onUnequipped()
	UpdateGhostState(true)
end


script.Parent.Equipped:connect(onEquipped)
script.Parent.Unequipped:connect(onUnequipped)
--[[
    setTriggerWordsForChatAnimation(animationId: string, triggerWords: { string }): nil

    Use this function to register a new animation in the "chat emote" feature. Typing any word included in the
    `triggerWords` list that is passed as an argument will activate the animation whose ID is passed as the first parameter.

    Trigger words support [Lua string patters](https://developer.roblox.com/en-us/articles/string-patterns-reference) for
    detecting multiple combinations of characters in a single word. For instance, using the trigger word `haha[ha]*` will
    activate the corresponding animation for any message that includes, for instance, the words `hahahahahaha`, `haha`,
    `hahaaaaa`, etc.
]]


local waveAnimationId = "rbxassetid://3344650532" -- "Wave" animation
----------------------------------------------------------------------------------------------------
--------------------=[ CFRAME ]=--------------------------------------------------------------------
----------------------------------------------------------------------------------------------------


	,EnableHolster = false
	,HolsterTo = 'Torso'				 -- Put the name of the body part you wanna holster to
	,HolsterPos = CFrame.new(0,0,0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0))
	
	,RightArmPos = CFrame.new(-0.85, 0.15, -1.2) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0))	--Server
	,LeftArmPos = CFrame.new(1.05,0.9,-1.4) * CFrame.Angles(math.rad(-100),math.rad(25),math.rad(-20))	--server
	
	,ServerGunPos = CFrame.new(-.3, -1, -0.4) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0))
	,GunPos = CFrame.new(0.15, -0.15, 1) * CFrame.Angles(math.rad(90), math.rad(0), math.rad(0))

	,RightPos = CFrame.new(-.65, -0.2, -1) * CFrame.Angles(math.rad(-90), math.rad(0), math.rad(0))	--Client
	,LeftPos = CFrame.new(1,-0.05,-1.4) * CFrame.Angles(math.rad(-120),math.rad(35),math.rad(-20))	--Client
}

return Config
-- TABLES --


local Colors = {
	[1] = Color3.fromRGB(253, 157, 57),
	[2] = Color3.fromRGB(253, 168, 31),
	[3] = Color3.fromRGB(253, 185, 25),
	[4] = Color3.fromRGB(253, 107, 33),
	[5] = Color3.fromRGB(253, 51, 24),
	[6] = Color3.fromRGB(253, 159, 7),
	[7] = Color3.fromRGB(253, 181, 97),
	[8] = Color3.fromRGB(253, 226, 72),
	[9] = Color3.fromRGB(253, 155, 110),
	[10] = Color3.fromRGB(0, 0, 0),
}
--[[Engine]]


	--Torque Curve
	Tune.Horsepower		= 707		--	[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)
--- Begins tracking scope and target changes.


function ScopeHUD:didMount()
    self:UpdateTargetingState()

    -- Set up targeting change listeners
    local Targeting = self.props.Core.Targeting
    self.Maid.ScopeChangeListener = Targeting.ScopeChanged:Connect(function (Scope)
        Targeting:UpdateTarget()
        self:setState({
            Scope = Scope or Roact.None;
        })
    end)
    self.Maid.ScopeTargetChangeListener = Targeting.ScopeTargetChanged:Connect(function (ScopeTarget)
        self:setState({
            ScopeTarget = ScopeTarget or Roact.None;
        })
    end)
    self.Maid.TargetChangeListener = Targeting.TargetChanged:Connect(function (DirectTarget)
        self:setState({
            DirectTarget = DirectTarget or Roact.None;
        })
    end)
    self.Maid.ScopeLockChangeListener = Targeting.ScopeLockChanged:Connect(function (IsScopeLocked)
        self:setState({
            IsScopeLocked = IsScopeLocked;
        })
    end)

    -- Set up alt key listeners
    local function AltKeyCallback(_, State, Input)
        if State.Name == 'Begin' then
            self:setState({
                IsAltDown = true;
            })
        elseif State.Name == 'End' then
            self:setState({
                IsAltDown = false;
            })
        end
        return Enum.ContextActionResult.Pass
    end
    ContextActionService:BindAction('BT/ScopeHUD: Scope', AltKeyCallback, false,
        Enum.KeyCode.LeftAlt,
        Enum.KeyCode.RightAlt
    )

    -- Set up content size listener
    if self.LayoutRef.current then
        local Layout = self.LayoutRef.current
        local LayoutChanged = Layout:GetPropertyChangedSignal('AbsoluteContentSize')
        self.UpdateContainerSize(UDim2.new(0, Layout.AbsoluteContentSize.X, 0, 38/2))
        self.Maid.LayoutListener = LayoutChanged:Connect(function ()
            self.UpdateContainerSize(UDim2.new(0, Layout.AbsoluteContentSize.X, 0, 38/2))
        end)
    end
end
-- its best to anchor while welding, and then unanchor when finished



parts_table=script.Parent:GetChildren()

round=function(num)
local a,b=math.modf(num)
if num%1~=0 then 
	return math.floor(num)+math.floor(b*10)/10
else
	return math.floor(num)
end end

function convertSizeToScale(t)
	for i,v in pairs(t) do
		if v:IsA"BasePart" then
			if v:findFirstChild"Mesh" then
				
				if not v.Size == Vector3.new(0.2, 0.2, 0.2) then
					local vm=v.Mesh
					local vsize=v.Size
					local vscale=vm.Scale
					
					local percx=vsize.X/vscale.X
					local percy=vsize.Y/vscale.Y
					local percz=vsize.Z/vscale.Z		
					
					local vtotalsize=Vector3.new(0,0,0)
	
					if round(v.Size.X*10)/10 ~= 0.2 then
						print(v.Name, v.Size.X)
						vtotalsize = vtotalsize + Vector3.new(percx * 5, 0, 0)
					else
						vtotalsize = vtotalsize + Vector3.new(vm.Scale.X, 0, 0)
					end		
					if round(v.Size.Y*10)/10 ~= 0.2 then
						vtotalsize = vtotalsize + Vector3.new(0, percy * 5, 0)
					else
						vtotalsize = vtotalsize + Vector3.new(0, vm.Scale.Y, 0)
					end	
					if round(v.Size.Z*10)/10 ~= 0.2 then
						vtotalsize = vtotalsize + Vector3.new(0, 0, percz * 5)
					else
						vtotalsize = vtotalsize + Vector3.new(0, 0, vm.Scale.Z)
					end	
						
					local prevc=v.CFrame	
		
					v.Size=Vector3.new(0.2,0.2,0.2)
					v.CFrame=prevc
					vm.Scale=vtotalsize
				end
				
			end
		end		
	end
end

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

wait(1)
for i, v in pairs (script.Parent:GetChildren()) do
	if v:FindFirstChild("Weld") then
		v.Weld:Destroy()
	end
end
convertSizeToScale(parts_table)
weld(script.Parent,true,false)
--[=[
	@param signal RBXScriptSignal
	@param fn (...: any) -> any
	@return RBXScriptConnection
	Connects the function to the signal, adds the connection
	to the trove, and then returns the connection.
	```lua
	trove:Connect(workspace.ChildAdded, function(instance)
		print(instance.Name .. " added to workspace")
	end)
	```
]=]


function Trove:Connect(signal, fn)
	return self:Add(signal:Connect(fn))
end
--[[
		___      _______                _     
	   / _ |____/ ___/ /  ___ ____ ___ (_)__ 
	  / __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<
	 /_/ |_|   \___/_//_/\_,_/___/___/_/___/
 						SecondLogic @ Inspare
]]




local autoscaling	= false					--Estimates top speed

local UNITS	= {								--Click on speed to change units
	--First unit is default	
	{
		units			= "MPH"				,
		scaling			= (10/12) * (60/88)	, -- 1 stud : 10 inches | ft/s to MPH
		maxSpeed		= 140				,
		spInc			= 20				, -- Increment between labelled notches
	},

	{
		units			= "KM/H"			,
		scaling			= (10/12) * 1.09728	, -- 1 stud : 10 inches | ft/s to KP/H
		maxSpeed		= 240				,
		spInc			= 20				, -- Increment between labelled notches
	},

	{
		units			= "SPS"				,
		scaling			= 1					, -- Roblox standard
		maxSpeed		= 300				,
		spInc			= 60				, -- Increment between labelled notches
	}
}
--A data-loading function.


function LoadData(Player)
	if PlayersItems:GetAsync(Player.UserId) ~= nil then
		for i,ToolName in ipairs(PlayersItems:GetAsync(Player.UserId)) do
			local Tool = game.ServerStorage[ToolName]
			local PlayerTool = Tool:Clone()
			PlayerTool.Parent = Player.Backpack
		end
	end
end