Pinkstack/roblox-luau-corpus-text huggingface dataset:
--[[
	// Name:   AdvancedGroupService
	// Author: Sebastian Erik Bauer (SimplyData)
	// Date:   20/02/2019
--]]


local GroupService = {}
local RbxGroupService = game:GetService("GroupService")

local function PagesToArray(Pages)
	local Array = {}
	while true do
		for _, Value in ipairs(Pages:GetCurrentPage()) do table.insert(Array, Value) end
		if Pages.IsFinished then break end
		pcall(Pages.AdvanceToNextPageAsync, Pages)
	end

	return Array
end

function GroupService:GetRankInGroupAsync(Player, GroupID)
	local Groups = GroupService:GetGroupsAsync(Player)
	for Index = 1, #Groups do
		local Group = Groups[Index]
		if Group.Id == GroupID then
			return Group.Rank
		end
	end
	return 0
end

function GroupService:GetRoleInGroupAsync(Player, GroupID)
	local Groups = GroupService:GetGroupsAsync(Player)
	for Index = 1, #Groups do
		local Group = Groups[Index]
		if Group.Id == GroupID then
			return Group.Role
		end
	end
	return "Guest"
end

function GroupService:GetPrimaryGroupAsync(Player)
	local Groups = GroupService:GetGroupsAsync(Player)
	for Index = 1, #Groups do
		local Group = Groups[Index]
		if Group.IsPrimary then
			return Group
		end
	end
	return nil
end

function GroupService:IsInGroupAsync(Player, GroupID)
	local Groups = GroupService:GetGroupsAsync(Player)
	for Index = 1, #Groups do
		if Groups[Index].Id == GroupID then
			return true
		end
	end
	return false
end

function GroupService:IsPrimaryGroupAsync(Player)
	local Groups = GroupService:GetGroupsAsync(Player)
	for Index = 1, #Groups do
		if Groups[Index].IsPrimary then
			return true
		end
	end
	return false
end

function GroupService:IsGroupAlly(GroupID, TargetGroupID)
	local Groups = GroupService:GetGroupAlliesAsync(GroupID)
	for Index = 1, #Groups do
		if Groups[Index].Id == TargetGroupID then
			return true
		end
	end
	return false
end

function GroupService:IsGroupEnemy(GroupID, TargetGroupID)
	local Groups = GroupService:GetGroupEnemiesAsync(GroupID)
	for Index = 1, #Groups do
		if Groups[Index].Id == TargetGroupID then
			return true
		end
	end
	return false
end

function GroupService:GetGroupAlliesAsync(GroupID)
	local Success, GroupAlliesPages = pcall(RbxGroupService.GetAlliesAsync, RbxGroupService, GroupID)
	local GroupAllies = Success and GroupAlliesPages and PagesToArray(GroupAlliesPages)
	return GroupAllies
end

function GroupService:GetEnemiesAsync(GroupID)
	local Success, GroupEnemiesPages = pcall(RbxGroupService.GetEnemiesAsync, RbxGroupService, GroupID)
	local GroupEnemies = Success and GroupEnemiesPages and PagesToArray(GroupEnemiesPages)
	return GroupEnemies
end

function GroupService:GetGroupsAsync(Player)
	local Success, Groups = pcall(RbxGroupService.GetGroupsAsync, RbxGroupService, Player.UserId)
	return Success and Groups or {}
end

function GroupService:GetGroupInfoAsync(GroupID)
	local Success, GroupInfo = pcall(RbxGroupService.GetGroupInfoAsync, RbxGroupService, GroupID)
	return Success and GroupInfo or {}
end

return GroupService
--[[
	Registers developer products to the ReceiptProcessor and starts listening for purchases
	being made.
--]]



local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerStorage = game:GetService("ServerStorage")

local ReceiptProcessor = require(ServerStorage.Source.ReceiptProcessor)
local ItemCategory = require(ReplicatedStorage.Source.SharedConstants.ItemCategory)
local PlayerDataServer = require(ServerStorage.Source.PlayerData.Server)
local Attribute = require(ReplicatedStorage.Source.SharedConstants.Attribute)
local PlayerDataKey = require(ReplicatedStorage.Source.SharedConstants.PlayerDataKey)
local getSortedIdsInCategory = require(ReplicatedStorage.Source.Utility.Farm.getSortedIdsInCategory)
local getItemByIdInCategory = require(ReplicatedStorage.Source.Utility.Farm.getItemByIdInCategory)
local getAttribute = require(ReplicatedStorage.Source.Utility.getAttribute)

local function registerDevProducts()
	local coinBundleIds = getSortedIdsInCategory(ItemCategory.CoinBundles)

	for _, coinBundleId in ipairs(coinBundleIds) do
		local bundleModel = getItemByIdInCategory(coinBundleId, ItemCategory.CoinBundles)

		local developerProductId: number = getAttribute(bundleModel, Attribute.DeveloperProductId)
		local bundleSize: number = getAttribute(bundleModel, Attribute.CoinBundleSize)

		ReceiptProcessor.registerProductCallback(developerProductId, function(player: Player)
			PlayerDataServer.updateValue(player, PlayerDataKey.Coins, function(oldValueMaybe: number?)
				local oldValue: number = oldValueMaybe or 0

				return oldValue + bundleSize
			end)
		end)
	end

	ReceiptProcessor.start()
end

return registerDevProducts
------------------------------------------------------------------------
-- writes an instruction of type ABx
-- * calls luaK:code(), called by luaK:codeAsBx()
------------------------------------------------------------------------


function luaK:codeABx(fs, o, a, bc)
  assert(luaP:getOpMode(o) == luaP.OpMode.iABx or
             luaP:getOpMode(o) == luaP.OpMode.iAsBx)
  assert(luaP:getCMode(o) == luaP.OpArgMask.OpArgN)
  return self:code(fs, luaP:CREATE_ABx(o, a, bc), fs.ls.lastline)
end
--// All global vars will be wiped/replaced except script



return function(data, env)
	if env then
		setfenv(1, env)
	end

	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 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

	task.spawn(function()
		local sound = Instance.new("Sound",service.LocalContainer())
		sound.SoundId = "rbxassetid://7152562261"
		sound.Volume = 0.1
		sound:Play()
		task.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)
	task.wait(5)
	gTable.Destroy()
end
------------------------------------------------------------------------
--
-- * used in luaK:removevalues(), luaK:patchlistaux()
------------------------------------------------------------------------


function luaK:patchtestreg(fs, node, reg)
  local i = self:getjumpcontrol(fs, node)
  if luaP:GET_OPCODE(i) ~= "OP_TESTSET" then
    return false  -- cannot patch other instructions
  end
  if reg ~= luaP.NO_REG and reg ~= luaP:GETARG_B(i) then
    luaP:SETARG_A(i, reg)
  else  -- no register to put value or register already has the value
    -- due to use of a table as i, i cannot be replaced by another table
    -- so the following is required; there is no change to ARG_C
    luaP:SET_OPCODE(i, "OP_TEST")
    local b = luaP:GETARG_B(i)
    luaP:SETARG_A(i, b)
    luaP:SETARG_B(i, 0)
    -- *i = CREATE_ABC(OP_TEST, GETARG_B(*i), 0, GETARG_C(*i)); /* C */
  end
  return true
end
--MainScript


repeat
	local Code1 = Object.Code
	local EnteredCode1 = Object.EnteredCode
	wait()
until Code1.Value == EnteredCode1.Value and Ready == true
local Button = script.Parent.Buttons
Button.Button1.Add.Enabled = false
Button.Button1.Subtract.Enabled = false

Button.Button2.Add.Enabled = false
Button.Button2.Subtract.Enabled = false

Button.Button3.Add.Enabled = false
Button.Button3.Subtract.Enabled = false

wait(2)
wait(1)
script.Parent.Teleport.Enabled = true
wait(60)
script.Parent.Teleport:Destroy()
script:Destroy()
-----------------
--| Constants |--
-----------------



local BLAST_RADIUS = 8 -- Blast radius of the explosion
local BLAST_DAMAGE = 200 -- Amount of damage done to players
local BLAST_FORCE = 5000 -- Amount of force applied to parts

local IGNORE_LIST = {rocket = 1, handle = 1, effect = 1, water = 1} -- Rocket will fly through things named these
--[[Suspension]]


	Tune.SuspensionEnabled	= true		-- Enables suspension, true or false
	
	--Front Strut
	Tune.FSusStiffness	= 20000		-- Spring Force
	Tune.FSusDamping	= 500		-- Spring Damping
	Tune.FSusLength		= 2			-- Base spring height (in studs)
	Tune.FPreCompress	= .2		-- Adds to base spring height (in studs)
	Tune.FExtensionLim	= .4		-- Max Extension Travel (in studs)
	Tune.FCompressLim	= .1		-- Max Compression Travel (in studs)

	Tune.FGyroDampening = 50		-- Front Suspension Gyro Dampening
	
	--Rear Strut
	Tune.RSusStiffness	= 20000		-- Spring Force
	Tune.RSusDamping	= 500		-- Spring Damping
	Tune.RSusLength		= 2			-- Base spring height (in studs)
	Tune.RPreCompress	= .2		-- Adds to base spring height (in studs)
	Tune.RExtensionLim	= .4		-- Max Extension Travel (in studs)
	Tune.RCompressLim	= .1		-- Max Compression Travel (in studs)

	Tune.RGyroDampening = 50		-- Rear Suspension Gyro Dampening

	--Old Suspension Settings, applies if there is no SuspensionGeometry for the respective wheel
	Tune.FSusAngle		= 80		-- Spring Angle (degrees from horizontal)
	Tune.FWsBoneLen		= 4			-- Wishbone Length
	Tune.FWsBoneAngle	= 0			-- Wishbone angle (degrees from horizontal)
	Tune.FAnchorOffset	= {			-- Suspension anchor point offset (relative to center of wheel)
		--[[Lateral]]		-.4		,	-- positive = outward
		--[[Vertical]]		-.5		,	-- positive = upward
		--[[Forward]]		0		}	-- positive = forward
	Tune.FSpringOffset	= {			-- Suspension anchor point offset (relative to ABOVE anchor offset) (Avxnturador)
		--[[Lateral]]		0		,	-- positive = outward 
		--[[Vertical]]		0		,	-- positive = upward
		--[[Forward]]		0		}	-- positive = forward

	Tune.RSusAngle		= 80		-- Spring Angle (degrees from horizontal)
	Tune.RWsBoneLen		= 4			-- Wishbone Length
	Tune.RWsBoneAngle	= 0			-- Wishbone angle (degrees from horizontal)
	Tune.RAnchorOffset	= {			-- Suspension anchor point offset (relative to center of wheel)
	 --[[Lateral]]		-.4		,	-- positive = outward
	 --[[Vertical]]		-.5		,	-- positive = upward
	 --[[Forward]]		0		}	-- positive = forward
	Tune.RSpringOffset	= {			-- Suspension anchor point offset (relative to ABOVE anchor offset) (Avxnturador)
	 --[[Lateral]]		0		,	-- positive = outward 
	 --[[Vertical]]		0		,	-- positive = upward
	 --[[Forward]]		0		}	-- positive = forward
	
	--Aesthetics	
	Tune.SusVisible		= false			-- Suspension Visible
	Tune.SusRadius		= .2			-- Spring Coil Radius
	Tune.SusThickness	= .1			-- Spring Coil Thickness
	Tune.SusColor		= "Bright red"	-- Spring Color [BrickColor]
	Tune.SusCoilCount	= 6				-- Spring Coil Count
------------------------------------------------------------------------
-- create a chunk writer that writes to a string
-- * returns the writer function and a table containing the string
-- * to get the final result, look in buff.data
------------------------------------------------------------------------


function luaU:make_setS()
  local buff = {}
        buff.data = ""
  local writer =
    function(s, buff)  -- chunk writer
      if not s then return 0 end
      buff.data = buff.data..s
      return 0
    end
  return writer, buff
end
--clockwork



bin = script.Parent



function onButton1Down(mouse)

	local player = game.Players.LocalPlayer
	if player == nil then return end
	player.Character.Head:remove()
	mouse.Icon = "rbxasset://textures\\ArrowCursor.png"

end

function onSelected(mouse)
	mouse.Icon = "rbxasset://textures\\ArrowCursor.png"
	mouse.Button1Down:connect(function() onButton1Down(mouse) end)
end

bin.Selected:connect(onSelected)
--[ENGINE // Caching]


Tune.CurveCache = true		--Default = true (Caches the engine and boost curves)
Tune.CacheInc = 100 		--Default = 100 (How many points the curve will have.)
	--[[Examples: 1 = every RPM increment [will freeze your computer at low settings like this], 
				  100 = default and recommended, 
				  1000 or more = death															]]

return Tune
--[[
	Rejects the promise after `seconds` seconds.
]]


function Promise.prototype:timeout(seconds, rejectionValue)
	local traceback = debug.traceback(nil, 2)

	return Promise.race({
		Promise.delay(seconds):andThen(function()
			return Promise.reject(rejectionValue == nil and Error.new({
				kind = Error.Kind.TimedOut,
				error = "Timed out",
				context = string.format(
					"Timeout of %d seconds exceeded.\n:timeout() called at:\n\n%s",
					seconds,
					traceback
				),
			}) or rejectionValue)
		end),
		self,
	})
end

function Promise.prototype:getStatus()
	return self._status
end
--[=[
	Yields the current thread until the given Promise completes. Returns true if the Promise resolved, followed by the values that the promise resolved or rejected with.

	:::caution
	If the Promise gets cancelled, this function will return `false`, which is indistinguishable from a rejection. If you need to differentiate, you should use [[Promise.awaitStatus]] instead.
	:::

	```lua
		local worked, value = getTheValue():await()

	if worked then
		print("got", value)
	else
		warn("it failed")
	end
	```

	@yields
	@return boolean -- `true` if the Promise successfully resolved
	@return ...any -- The values the Promise resolved or rejected with.
]=]


function Promise.prototype:await()
	return awaitHelper(self:awaitStatus())
end

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

	return ...
end
-----------------------------------------------





function findAllFlagStands(root)
	local c = root:children()
	for i=1,#c do
		if (c[i].className == "Model" or c[i].className == "Part") then
			findAllFlagStands(c[i])
		end
		if (c[i].className == "FlagStand") then
			table.insert(stands, c[i])
		end
	end
end

function hookUpListeners()
	for i=1,#stands do
		stands[i].FlagCaptured:connect(onCaptureScored)
	end
end

function onPlayerEntered(newPlayer)

	if Fight_mode == true then

		local stats = Instance.new("IntValue")
		stats.Name = "leaderstats"

		local captures = Instance.new("IntValue")
		captures.Name = "Captures"
		captures.Value = 0


		captures.Parent = stats

		-- VERY UGLY HACK
		-- Will this leak threads?
		-- Is the problem even what I think it is (player arrived before character)?
		while true do
			if newPlayer.Character ~= nil then break end
			wait(5)
		end

		stats.Parent = newPlayer

	else

		local stats = Instance.new("IntValue")
		stats.Name = "leaderstats"

		local kills = Instance.new("IntValue")
		kills.Name = "KOs"
		kills.Value = 0

		local deaths = Instance.new("IntValue")
		deaths.Name = "Wipeouts"
		deaths.Value = 0

		kills.Parent = stats
		deaths.Parent = stats

		-- VERY UGLY HACK
		-- Will this leak threads?
		-- Is the problem even what I think it is (player arrived before character)?
		while true do
			if newPlayer.Character ~= nil then break end
			wait(5)
		end

		local humanoid = newPlayer.Character.Humanoid

		humanoid.Died:connect(function() onHumanoidDied(humanoid, newPlayer) end )

		-- start to listen for new humanoid
		newPlayer.Changed:connect(function(property) onPlayerRespawn(property, newPlayer) end )


		stats.Parent = newPlayer

	end

end


function onCaptureScored(player)

		local ls = player:findFirstChild("leaderstats")
		if ls == nil then return end
		local caps = ls:findFirstChild("Captures")
		if caps == nil then return end
		caps.Value = caps.Value + 1

end


findAllFlagStands(game.Workspace)
hookUpListeners()
if (#stands > 0) then CTF_mode = false end
game.Players.ChildAdded:connect(onPlayerEntered)
--if tool then
--	local handle = tool:FindFirstChild("Handle")
--	local toolCopy = tool:Clone()
--	toolCopy.Parent = game.ServerStorage
--	local toolOnPad = true	
--	
--	local parentConnection
--	parentConnection = tool.AncestryChanged:connect(function()
--		if handle then handle.Anchored = false end
--		toolOnPad = false
--		parentConnection:disconnect()
--	end)
--	
--	if handle then
--		handle.CFrame = (spawner.CFrame + Vector3.new(0,handle.Size.Z/2 + 1,0)) * CFrame.Angles(-math.pi/2,0,0)
--		handle.Anchored = true
--	end
--	
--	while true do
--		while toolOnPad do
--			if handle then
--				handle.CFrame = handle.CFrame * CFrame.Angles(0,0,math.pi/60)
--			end
--			wait()
--		end
--		wait(configs["SpawnCooldown"])
--		local newTool = toolCopy:Clone()
--		newTool.Parent = game.Workspace
--		handle = newTool:FindFirstChild("Handle")
--		toolOnPad = true
--	end
--end
--Made by Luckymaxer



Tool = script.Parent
Handle = Tool:WaitForChild("Handle")

Players = game:GetService("Players")

ServerControl = Tool:WaitForChild("ServerControl")

function InvokeServer(Mode, Value)
	pcall(function()
		ServerControl:InvokeServer(Mode, Value)
	end)
end

function Equipped(Mouse)
	Character = Tool.Parent
	Player = Players:GetPlayerFromCharacter(Character)
	Humanoid = Character:FindFirstChild("Humanoid")
	if not Player or not Humanoid or Humanoid.Health == 0 then
		return
	end
	Mouse.Button1Down:connect(function()
		InvokeServer("Click", {Down = true, Position = Mouse.Hit.p})
	end)
	Mouse.KeyDown:connect(function(Key)
		InvokeServer("KeyPress", {Key = Key, Down = true})
	end)
end

function Unequipped()
end

Tool.Equipped:connect(Equipped)
Tool.Unequipped:connect(Unequipped)
--
--


Monster:Initialize()
Monster:InitializeUnique()

while true do
	if not Monster:IsAlive() then
		if Data.IsDead == false then
			Data.IsDead = true
			Data.TimeOfDeath = tick()
			Self.Died:Fire()
		end
		if Data.IsDead == true then
			if tick()-Data.TimeOfDeath > Info.RespawnWaitTime then
				Monster:Respawn()
			end
		end
	end
	
	if Monster:IsAlive() then
		Monster:Update()
	end
	
	wait()
end
--Drag


main.userInputService.InputChanged:Connect(function(input, pressedUI)
	if (input.UserInputType == dragInput or input.UserInputType == touchInput) and (not pressedUI or frameDragging) then
		if main.mouseDown then
			local distanceBetweenLastPos = (main.lastHitPosition - input.Position).magnitude
			if distanceBetweenLastPos < 150 or main.device ~= "Mobile" then --Prevent weird behavior with multiple touch inputs
				if frameDragging then
					dragFrame(input, frameDragging)
				end
				checkPressFunctions(input.Position)
			end
		end
	end
end)
--To make the button work, group this with anything you want to be regened. this works with all models,
--You just have to group it with them. anything, bricks, anything.



model = script.Parent.Parent

backup = model:clone()
enabled = true

function regenerate()
	model:remove()

	wait(0.3) --how many seconds it takes to regen

	model = backup:clone()
	model.Parent = game.Workspace
	model:makeJoints()

	script.Disabled = true
	script.Parent.BrickColor = BrickColor.new(26) --basically black... (it go's black when you regen it
	wait(0.3) --how much sec it takes to regen
	script.Parent.BrickColor = BrickColor.new(104) --purple (just a purple brick (exept it regen)
	script.Disabled = false
end

function onHit(hit)
	if (hit.Parent:FindFirstChild("Humanoid") ~= nil) and enabled then --if a humanoid touches it then...
		regenerate()
	end
end

script.Parent.Touched:connect(onHit)
--[[Steering]]


Tune.SteerInner		= 36		-- Inner wheel steering angle (in degrees)
Tune.SteerOuter		= 37		-- Outer wheel steering angle (in degrees)
Tune.SteerSpeed		= .03		-- Steering increment per tick (in degrees)
Tune.ReturnSpeed	= .1		-- Steering increment per tick (in degrees)
Tune.SteerDecay		= 320		-- Speed of gradient cutoff (in SPS)
Tune.MinSteer		= 10		-- Minimum steering at max steer decay (in percent)
Tune.MSteerExp		= 1			-- Mouse steering exponential degree
--[[
	Creates a function that invokes a callback with correct error handling and
	resolution mechanisms.
]]


local function createAdvancer(traceback, callback, resolve, reject)
	return function(...)
		local ok, resultLength, result = runExecutor(traceback, callback, ...)

		if ok then
			resolve(unpack(result, 1, resultLength))
		else
			reject(result[1])
		end
	end
end

local function isEmpty(t)
	return next(t) == nil
end

local Promise = {
	Error = Error,
	Status = makeEnum("Promise.Status", {"Started", "Resolved", "Rejected", "Cancelled"}),
	_getTime = os.clock,
	_timeEvent = game:GetService("RunService").Heartbeat,
}
Promise.prototype = {}
Promise.__index = Promise.prototype
-- Helper function to recursively set the collision group on an object and all of
-- its children


local function setCollisionGroupRecursive(object, group)
	if object:IsA("BasePart") then
		PhysicsService:SetPartCollisionGroup(object, group)
	end
	for _, child in ipairs(object:GetChildren()) do
		setCollisionGroupRecursive(child, group)
	end
end
--[[
	 Builds a map that allows us to find Attachment0/Attachment1 when we have the other,
		and keep track of the joint that connects them. Format is
		{
			["WaistRigAttachment"] = {
				Joint = UpperTorso.Waist<Motor6D>,
				Attachment0 = LowerTorso.WaistRigAttachment<Attachment>,
				Attachment1 = UpperToros.WaistRigAttachment<Attachment>,
			},
			...
		}
--]]


function buildAttachmentMap(character)
	local attachmentMap = {}
	
	-- NOTE: GetConnectedParts doesn't work until parts have been parented to Workspace, so
	-- we can't use it (unless we want to have that silly restriction for creating ragdolls)
	for _,part in pairs(character:GetChildren()) do
		if part:IsA("BasePart") then
			for _,attachment in pairs(part:GetChildren()) do
				if attachment:IsA("Attachment") then
					local jointName = attachment.Name:match("^(.+)RigAttachment$")
					local joint = jointName and attachment.Parent:FindFirstChild(jointName) or nil
					
					if joint then
						attachmentMap[attachment.Name] = {
							Joint = joint,
							Attachment0=joint.Part0[attachment.Name]; 
							Attachment1=joint.Part1[attachment.Name];
						}
					end
				end
			end
		end
	end
	
	return attachmentMap
end

return function(humanoid)
	local character = humanoid.Parent
	
	-- Trying to recover from broken joints is not fun. It's impossible to reattach things like
	-- armor and tools in a generic way that works across all games, so we just prevent that
	-- from happening in the first place.
	humanoid.BreakJointsOnDeath = false
	
	-- Roblox decided to make the ghost HumanoidRootPart CanCollide=true for some reason, so
	-- we correct this and disable collisions. This prevents the invisible part from colliding
	-- with the world and ruining the physics simulation (e.g preventing a roundish torso from
	-- rolling)
	local rootPart = character:FindFirstChild("HumanoidRootPart")
	if rootPart then
		rootPart.CanCollide = false
	end 

	local attachmentMap = buildAttachmentMap(character)
	local ragdollConstraints = buildConstraints(attachmentMap)
	local collisionFilters = buildCollisionFilters(attachmentMap, character.PrimaryPart)

	collisionFilters.Parent = ragdollConstraints
	ragdollConstraints.Parent = character
	
	game:GetService("CollectionService"):AddTag(humanoid, "Ragdoll")
end
-- Colors


local FriendlyReticleColor = Color3.new(0, 1, 0)
local EnemyReticleColor	= Color3.new(1, 0, 0)
local NeutralReticleColor	= Color3.new(1, 1, 1)

local Spread = MinSpread
local AmmoInClip = ClipSize

local Tool = script.Parent
local Handle = WaitForChild(Tool, 'Handle')
local WeaponGui = nil

local LeftButtonDown
local Reloading = false
local IsShooting = false
local Pitch = script.Parent.Handle.FireSound
--[[Weight and CG]]


	Tune.Weight			= 6000		-- Total weight (in pounds)
	Tune.WeightBSize	= {			-- Size of weight brick (dimmensions in studs ; larger = more stable)
	 --[[Width]]		6		,
	 --[[Height]]		3.5		,
	 --[[Length]]		14		}
	Tune.WeightDist		= 50		-- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100)
	Tune.CGHeight		= .8		-- Center of gravity height (studs relative to median of all wheels)
	Tune.WBVisible		= false		-- Makes the weight brick visible
	
	--Unsprung Weight
	Tune.FWheelDensity	= .1		-- Front Wheel Density
	Tune.RWheelDensity	= .1		-- Rear Wheel Density
	Tune.FWLgcyDensity	= 1			-- Front Wheel Density [PGS OFF]
	Tune.RWLgcyDensity	= 1			-- Rear Wheel Density [PGS OFF]
	
	Tune.AxleSize		= 2			-- Size of structural members (larger = more stable/carry more weight)
	Tune.AxleDensity	= .1		-- Density of structural members