Pinkstack/roblox-luau-corpus-text huggingface dataset:
--[[
	Adds a change listener. When the watched state changes value, the listener
	will be fired.

	Returns a function which, when called, will disconnect the change listener.
	As long as there is at least one active change listener, this Observer
	will be held in memory, preventing GC, so disconnecting is important.
]]


function class:onChange(callback: () -> ()): () -> ()
	local uniqueIdentifier = {}

	self._numChangeListeners += 1
	self._changeListeners[uniqueIdentifier] = callback

	-- disallow gc (this is important to make sure changes are received)
	strongRefs[self] = true

	local disconnected = false
	
	return function()
		if disconnected then
			return
		end
		
		disconnected = true
		self._changeListeners[uniqueIdentifier] = nil
		self._numChangeListeners -= 1

		if self._numChangeListeners == 0 then
			-- allow gc if all listeners are disconnected
			strongRefs[self] = nil
		end
	end
end

local function Observer(watchedState)
	local self = setmetatable({
		type = "State",
		kind = "Observer",
		dependencySet = {[watchedState] = true},
		dependentSet = {},
		_changeListeners = {},
		_numChangeListeners = 0,
	}, CLASS_METATABLE)

	-- add this object to the watched state's dependent set
	watchedState.dependentSet[self] = true

	return self
end

return Observer
-------------------------------------------------------------------------



local function FlashRed(object)
	local origColor = object.BrickColor
	local redColor = BrickColor.new("Really red")
	local start = tick()
	local duration = 4
	spawn(function()
		while object and tick() - start < duration do
			object.BrickColor = origColor
			task.wait(0.13)
			if object then
				object.BrickColor = redColor
			end
			task.wait(0.13)
		end
	end)
end
--[[[Default Controls]]


	--Peripheral Deadzones
	Tune.Peripherals = {
		MSteerWidth				= 67		,	-- Mouse steering control width	(0 - 100% of screen width)
		MSteerDZone				= 10		,	-- Mouse steering deadzone (0 - 100%)
		
		ControlLDZone			= 5			,	-- Controller steering L-deadzone (0 - 100%)
		ControlRDZone			= 5			,	-- Controller steering R-deadzone (0 - 100%)
	}
	
	--Control Mapping
	Tune.Controls = {
		
	--Keyboard Controls
		--Mode Toggles
		ToggleTCS				= Enum.KeyCode.T					,
		ToggleABS				= Enum.KeyCode.Y					,
		ToggleTransMode			= Enum.KeyCode.M					,
		ToggleMouseDrive		= Enum.KeyCode.R					,
		
		--Primary Controls
		Throttle				= Enum.KeyCode.W					,
		Brake					= Enum.KeyCode.S					,
		SteerLeft				= Enum.KeyCode.A					,
		SteerRight				= 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			,
	}
--[[Weight and CG]]


	Tune.Weight			= 3000		-- 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		= 1		-- Size of structural members (larger = more stable/carry more weight)
	Tune.AxleDensity	= .1	-- Density of structural members
-- Signal:Fire(...) implemented by running the handler functions on the
-- coRunnerThread, and any time the resulting thread yielded without returning
-- to us, that means that it yielded to the Roblox scheduler and has been taken
-- over by Roblox scheduling, meaning we have to make a new coroutine runner.
--[=[
	@param ... any

	Fire the signal, which will call all of the connected functions with the given arguments.
	```lua
	signal:Fire("Hello")

	-- Any number of arguments can be fired:
	signal:Fire("Hello", 32, {Test = "Test"}, true)
	```
]=]


function Signal:Fire(...)
	local item = self._handlerListHead
	while item do
		if item.Connected then
			if not freeRunnerThread then
				freeRunnerThread = coroutine.create(runEventHandlerInFreeThread)
			end
			task.spawn(freeRunnerThread, item._fn, ...)
		end
		item = item._next
	end
end
--[[Engine]]


	--Torque Curve
	Tune.Horsepower		= 155		--	[TORQUE CURVE VISUAL]
	Tune.IdleRPM		= 600		--		https://www.desmos.com/calculator/2uo3hqwdhf
	Tune.PeakRPM		= 2100		--		Use sliders to manipulate values
	Tune.Redline		= 2700		--		Copy and paste slider values into the respective tune values
	Tune.EqPoint		= 2500
	Tune.PeakSharpness	= 2.5
	Tune.CurveMult		= 0.15
	
	--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)
--[[
		VRNavigation
--]]



local VRService = game:GetService("VRService")
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local Players = game:GetService("Players")
local PathfindingService = game:GetService("PathfindingService")
local ContextActionService = game:GetService("ContextActionService")
local StarterGui = game:GetService("StarterGui")
--[=[
	Adds a recursive child writer to use at the key `name`
	@param name string
	@param writer DataStoreWriter
]=]


function DataStoreWriter:AddWriter(name, writer)
	assert(type(name) == "string", "Bad name")
	assert(not self._writers[name], "Writer already exists for name")
	assert(writer, "Bad writer")

	self._writers[name] = writer
end
--[=[
	Gives a task to the maid for cleanup and returnsthe resulting value

	@param task MaidTask -- An item to clean
	@return MaidTask
]=]


function Maid:Add(task)
	if not task then
		error("Task cannot be false or nil", 2)
	end

	self[#self._tasks+1] = task

	if type(task) == "table" and (not task.Destroy) then
		warn("[Maid.GiveTask] - Gave table task without .Destroy\n\n" .. debug.traceback())
	end

	return task
end
-----------------------


if f1==1 then f1=0
	local b=script.b:Clone()
	b.Parent=script.Parent.PS.bu
	b.Position=UDim2.new(0,po1.X+8,0,po1.Y+6)
	b.BackgroundColor3=p1.BackgroundColor3
	b.inf.Value=Vector3.new(1,y1)
end
if z1==0 and s1==0 then
po1=po1+Vector3.new(x1,y1)/3 end
po1=po1.X<0 and Vector3.new(0,po1.Y)or po1
po1=po1.X>26 and Vector3.new(26,po1.Y)or po1
po1=po1.Y<0 and Vector3.new(po1.X,0)or po1
po1=po1.Y>25 and Vector3.new(po1.X,25)or po1
p1.Position=UDim2.new(0,po1.X,0,po1.Y)
local fr1,fr2='b'
if s1==1 then fr1='k'fr2='k'print'AAA'
elseif z1==1 then
fr1='b2'
fr2=y1==0 and's1'or y1==1 and's3'or's2'
elseif math.abs(x1)+math.abs(y1)>0 then
fr1='b'
fr2=math.sin(tick()*8)>0 and'l1'or'l2'
else
fr1='b'
fr2='l2'
end
for _,v in pairs(p1:GetChildren())do
if v.Name==fr1 or v.Name==fr2 then
v.Visible=true else v.Visible=false
end end
--Calculates an angle in relation to another part.


function core.findAngle(pos1,pos2,part)
	local yOrientation = part.Orientation.Y
	local rot = math.atan2(pos2.Z-pos1.Z, pos2.X-pos1.X)


	local desiredAngle = math.deg(rot)+yOrientation+90
	if desiredAngle > 180 then
		desiredAngle = -(360-desiredAngle)
	elseif desiredAngle <-180 then
		desiredAngle = 360+desiredAngle
	end	

	return desiredAngle
end

function core.findPitch(pos1,pos2,part)
	local xOrientation = part.Orientation.X
	local rot = math.atan2(pos2.Y-pos1.Y, math.abs(pos2.Z-pos1.Z))
	
	local desiredAngle = math.deg(rot)+xOrientation
	if desiredAngle > 180 then
		desiredAngle = -(360-desiredAngle)
	elseif desiredAngle <-180 then
		desiredAngle = 360+desiredAngle
	end	

	return desiredAngle
end

function core.tempAttach(pos,life)
	local attach = Instance.new("Attachment")
	attach.WorldPosition = pos
	attach.Parent = workspace.Terrain
	
	debrisService:AddItem(attach,life)
	
	return attach
end

function core.playSound(sound,pos)
	local attach = core.tempAttach(pos,sound.TimeLength)
	local soundClone = sound:Clone()
	soundClone.Parent = attach
	soundClone:Play()
end




return core
--[[ Public API ]]

--
function TouchJump:Enable()
	ExternallyEnabled = true
	enableButton()
end

function TouchJump:Disable()
	ExternallyEnabled = false
	disableButton()
end

function TouchJump:Create(parentFrame)
	if JumpButton then
		JumpButton:Destroy()
		JumpButton = nil
	end
	
	local minAxis = math.min(parentFrame.AbsoluteSize.x, parentFrame.AbsoluteSize.y)
	local isSmallScreen = minAxis <= 500
	local jumpButtonSize = isSmallScreen and 70 or 120
	
	JumpButton = Instance.new('ImageButton')
	JumpButton.Name = "JumpButton"
	JumpButton.Visible = false
	JumpButton.BackgroundTransparency = 1
	JumpButton.Image = TOUCH_CONTROL_SHEET
	JumpButton.ImageRectOffset = Vector2.new(1, 146)
	JumpButton.ImageRectSize = Vector2.new(144, 144)
	JumpButton.Size = UDim2.new(0, jumpButtonSize, 0, jumpButtonSize)

    JumpButton.Position = isSmallScreen and UDim2.new(1, -(jumpButtonSize*1.5-10), 1, -jumpButtonSize - 20) or
        UDim2.new(1, -(jumpButtonSize*1.5-10), 1, -jumpButtonSize * 1.75)
	
	local touchObject = nil	
	JumpButton.InputBegan:connect(function(inputObject)
		--A touch that starts elsewhere on the screen will be sent to a frame's InputBegan event
		--if it moves over the frame. So we check that this is actually a new touch (inputObject.UserInputState ~= Enum.UserInputState.Begin)
		if touchObject or inputObject.UserInputType ~= Enum.UserInputType.Touch
			or inputObject.UserInputState ~= Enum.UserInputState.Begin then
			return
		end
		
		touchObject = inputObject
		JumpButton.ImageRectOffset = Vector2.new(146, 146)
		MasterControl:SetIsJumping(true)
	end)
	
	OnInputEnded = function()
		touchObject = nil
		MasterControl:SetIsJumping(false)
		JumpButton.ImageRectOffset = Vector2.new(1, 146)
	end
	
	JumpButton.InputEnded:connect(function(inputObject)
		if inputObject == touchObject then
			OnInputEnded()
		end
	end)
	
	GuiService.MenuOpened:connect(function()
		if touchObject then
			OnInputEnded()
		end
	end)
	
	if not CharacterAddedConnection then
		setupCharacterAddedFunction()
	end
	
	JumpButton.Parent = parentFrame
end

return TouchJump
--Dont touch


ZR15RightLegPointZero = 0
XR15RightLegPointZero = 0
YR15RightLegPointZero = 0
R15RightKneePointZero = 0

ZR15RightArmPointZero = 0
YR15RightArmPointZero = 0
XR15RightArmPointZero = 0
R15RightElbowPointZero = 0

ZR15LeftLegPointZero = 0
XR15LeftLegPointZero = 0
YR15LeftLegPointZero = 0
R15LeftKneePointZero = 0

ZR15LeftArmPointZero = 0
YR15LeftArmPointZero = 0
XR15LeftArmPointZero = 0
R15LeftElbowPointZero = 0

ZR15LowerTorsoPointZero = 0
XR15LowerTorsoPointZero = 0
YR15LowerTorsoPointZero = 0
ZR15UpperTorsoPointZero = 0

bike.DriveSeat.ChildRemoved:connect(function(child)
	handler:FireServer("RemovePlayer",C,child) 
end)

handler:FireServer("CreatePlayer",C)
--[[**
	<description>
	Run this once to combine all keys provided into one "main key".
	Internally, this means that data will be stored in a table with the key mainKey.
	This is used to get around the 2-DataStore2 reliability caveat.
	</description>

	<parameter name = "mainKey">
	The key that will be used to house the table.
	</parameter>

	<parameter name = "...">
	All the keys to combine under one table.
	</parameter>
**--]]


function DataStore2.Combine(mainKey, ...)
	for _, name in pairs({...}) do
		combinedDataStoreInfo[name] = mainKey
	end
end

function DataStore2.ClearCache()
	DataStoreCache = {}
end

function DataStore2:__call(dataStoreName, player)
	assert(typeof(dataStoreName) == "string" and typeof(player) == "Instance", ("DataStore2() API call expected {string dataStoreName, Instance player}, got {%s, %s}"):format(typeof(dataStoreName), typeof(player)))
	if DataStoreCache[player] and DataStoreCache[player][dataStoreName] then
		return DataStoreCache[player][dataStoreName]
	elseif combinedDataStoreInfo[dataStoreName] then
		local dataStore = DataStore2(combinedDataStoreInfo[dataStoreName], player)

		dataStore:BeforeSave(function(combinedData)
			for key in pairs(combinedData) do
				if combinedDataStoreInfo[key] then
					local combinedStore = DataStore2(key, player)
					local value = combinedStore:Get(nil, true)
					if value ~= nil then
						if combinedStore.combinedBeforeSave then
							value = combinedStore.combinedBeforeSave(clone(value))
						end
						combinedData[key] = value
					end
				end
			end

			return combinedData
		end)

		local combinedStore = setmetatable({
			combinedName = dataStoreName,
			combinedStore = dataStore
		}, {
			__index = function(self, key)
				return CombinedDataStore[key] or dataStore[key]
			end
		})

		if not DataStoreCache[player] then
			DataStoreCache[player] = {}
		end

		DataStoreCache[player][dataStoreName] = combinedStore
		return combinedStore
	end

	local dataStore = {}

	dataStore.Name = dataStoreName
	dataStore.UserId = player.UserId

	dataStore.callbacks = {}
	dataStore.beforeInitialGet = {}
	dataStore.afterSave = {}
	dataStore.bindToClose = {}
	dataStore.savingMethod = SavingMethods.OrderedBackups.new(dataStore)

	setmetatable(dataStore, DataStoreMetatable)

	local event, fired = Instance.new("BindableEvent"), false

	game:BindToClose(function()
		if not fired then
			event.Event:wait()
		end

		local value = dataStore:Get(nil, true)

		for _, bindToClose in pairs(dataStore.bindToClose) do
			bindToClose(player, value)
		end
	end)

	local playerLeavingConnection
	playerLeavingConnection = player.AncestryChanged:Connect(function()
		if player:IsDescendantOf(game) then return end
		playerLeavingConnection:Disconnect()
		dataStore:Save()
		event:Fire()
		fired = true

		delay(40, function() --Give a long delay for people who haven't figured out the cache :^(
			DataStoreCache[player] = nil
		end)
	end)

	if not DataStoreCache[player] then
		DataStoreCache[player] = {}
	end

	DataStoreCache[player][dataStoreName] = dataStore

	return dataStore
end

return setmetatable(DataStore2, DataStore2)
--[[
	Issues a warning with an automatically attached stack trace.
]]


function Logging.warn(messageTemplate, ...)
	local message = messageTemplate:format(...)

	for collector in pairs(collectors) do
		table.insert(collector.warnings, message)
	end

	-- debug.traceback inserts a leading newline, so we trim it here
	local trace = debug.traceback("", 2):sub(2)
	local fullMessage = ("%s\n%s"):format(message, indent(trace, 1))

	if outputEnabled then
		warn(fullMessage)
	end
end
-- not code


local PurplePlayers = script.Parent.PurplePlayers
local OrangePlayers = script.Parent.OrangePlayers
function newgame()
	
	
	
	matchStarted = true
	
	wait(3)
	
	for i, player in pairs(game.Teams["Orange Team"]:GetPlayers()) do
	player.Character:MoveTo(game.Workspace.OrangeTeleport.CFrame.p)
	end
	
	for i, player in pairs(game.Teams["Purple Team"]:GetPlayers()) do
		player.Character:MoveTo(game.Workspace.PurpleTeleport.CFrame.p)
	end
	
	-- clear dodgebool
	game.Workspace.DodgeBalls:ClearAllChildren()
	
	--redo
	for i, ballSpawn in ipairs(game.Workspace.DodgeBallSpawns:GetChildren()) do
		local newBall = game.Workspace.DogeBall:Clone()
		newBall.Parent = game.Workspace.DodgeBalls
		newBall.Handle.CFrame = ballSpawn.CFrame
	end	
	
	PurplePlayers.Value = table.getn(game.Teams['Orange Team']:GetPlayers())
	OrangePlayers.Value = table.getn(game.Teams['Purple Team']:GetPlayers())
	
	for i, sparkler in ipairs(game.Workspace.Sparklers:GetChildren()) do
		sparkler.Sparkles.Enabled = false
	end
	
end
while true do
	
	if matchStarted then
		
		if PurplePlayers.Value <= 0 then
			
			for i, sparkler in ipairs(game.Workspace.Sparklers:GetChildren()) do
				sparkler.Sparkles.Enabled = true
				sparkler.Sparkles.SparkleColor = Color3.fromRGB(255, 162, 0)
			end
			
			matchStarted = false
			
			wait(3)
		elseif OrangePlayers.Value <= 0 then
			for i, sparkler in ipairs(game.Workspace.Sparklers:GetChildren()) do
				sparkler.Sparkles.Enabled = true
				sparkler.Sparkles.SparkleColor = Color3.fromRGB(138, 0, 126)
			end
			
			
			--redo
			--for i, ballSpawn in ipairs(game.Workspace.DodgeBallSpawns:GetChildren()) do
			--	local newBall = game.Workspace.DogeBall:Clone()
			--	newBall.Parent = game.Workspace.DodgeBalls
			--	newBall.Handle.CFrame = ballSpawn.CFrame
			--end	
			
			
			matchStarted = false
			
			wait(3)
		 
		end
		
	else
		
		local purplePlayers = table.getn(game.Teams["Purple Team"]:GetPlayers())
		local orangePlayers = table.getn(game.Teams["Orange Team"]:GetPlayers())
		
	
			if purplePlayers > 0 and orangePlayers > 0 then
				
			newgame()
			
			end
			
		
	end
	
	wait(0.5)
	
end
--- Gives `Character` the 'Amount' of silver in the bag, returns true if it was successful.
---@param Amount number
---@param Character Model
---@return boolean


local function GiveSilver(Amount: number, Character: Model): boolean

	--// One thing I noticed about this function is that the names of variables were.. Odd.
	--// The target is to make anyone be able to see the function and the algorithm just clicks.
	--// So you know, define the prefab, make sure your names are pretty self-explantory but not 'ToolToGive', etc etc.

	local Player = game.Players:GetPlayerFromCharacter(Character)

	if (not Player) then
		return false
	end

	Player.Data.Silver.Value += Amount
	
	
	return true;
end
------------------------------------------------------------------------
-- parse a numerical for loop, calls forbody()
-- * used in forstat()
------------------------------------------------------------------------


function luaY:fornum(ls, varname, line)
  -- fornum -> NAME = exp1,exp1[,exp1] forbody
  local fs = ls.fs
  local base = fs.freereg
  self:new_localvarliteral(ls, "(for index)", 0)
  self:new_localvarliteral(ls, "(for limit)", 1)
  self:new_localvarliteral(ls, "(for step)", 2)
  self:new_localvar(ls, varname, 3)
  self:checknext(ls, '=')
  self:exp1(ls)  -- initial value
  self:checknext(ls, ",")
  self:exp1(ls)  -- limit
  if self:testnext(ls, ",") then
    self:exp1(ls)  -- optional step
  else  -- default step = 1
    luaK:codeABx(fs, "OP_LOADK", fs.freereg, luaK:numberK(fs, 1))
    luaK:reserveregs(fs, 1)
  end
  self:forbody(ls, base, line, 1, true)
end
-- init varible


local player = game.Players.LocalPlayer
local UserInputService = game:GetService("UserInputService")
local ContextActionService = game:GetService("ContextActionService")
local bindFuc = script.Parent:WaitForChild("BindableFunction")


local doJump = false
local startGame = false
local left = 0
local right = 0
local moveDir = 0
local moveSpeed = 40
local animSpeed = 0.05

game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, false)
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Health, false)
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)

local humanoid
local animator
local character
player:WaitForChild("PlayerGui")
player.CharacterAdded:Wait()
--returns the wielding player of this tool


function getPlayer()
	local char = Tool.Parent
	return game:GetService("Players"):GetPlayerFromCharacter(Character)
end

function Toss(direction)
	local handlePos = Vector3.new(Tool.Handle.Position.X, 0, Tool.Handle.Position.Z)
	local spawnPos = Character.Head.Position
	spawnPos  = spawnPos + (direction * 5)
	Tool.Handle.Transparency = 1
	local Object = Tool.Handle:Clone()
	Object.Parent = workspace
	Object.Transparency = 1
	Object.Swing.Pitch = math.random(90, 110)/100
	Object.Swing:Play()
	Object.CanCollide = true
	Object.CFrame = Tool.Handle.CFrame
	Object.Velocity = (direction*AttackVelocity) + Vector3.new(0,AttackVelocity/7.5,0)
	Object.Trail.Enabled = true
	--Object.Fuse:Play()
	--Object.Sparks.Enabled = true
	local rand = 11.25
	Object.RotVelocity = Vector3.new(math.random(-rand,rand),math.random(-rand,rand),math.random(-rand,rand))
	Object:SetNetworkOwner(getPlayer())
	local ScriptClone = DamageScript:Clone()
	ScriptClone.Parent = Object
	ScriptClone.Disabled = false
	local tag = Instance.new("ObjectValue")
	tag.Value = getPlayer()
	tag.Name = "creator"
	tag.Parent = Object
	Tool:Destroy()
end


script.Parent.Power.OnServerEvent:Connect(function(player, Power)
	AttackVelocity = Power
end)

Remote.OnServerEvent:Connect(function(player, mousePosition)
	if not AttackAble then return end
	AttackAble = false
	if Humanoid and Humanoid.RigType == Enum.HumanoidRigType.R15 then
		Remote:FireClient(getPlayer(), "PlayAnimation", "Animation")
	end
	local targetPos = mousePosition.p
	local lookAt = (targetPos - Character.Head.Position).unit
	Toss(lookAt)
	LeftDown = true
end)

function onLeftUp()
	LeftDown = false
end

Tool.Equipped:Connect(function()
	Character = Tool.Parent
	Humanoid = Character:FindFirstChildOfClass("Humanoid")
end)

Tool.Unequipped:Connect(function()
	Character = nil
	Humanoid = nil
end)
--[[
	Saved profile structure:
	
	DataStoreProfile = {
		Data = {},
		MetaData = {
			ProfileCreateTime = 0,
			SessionLoadCount = 0,
			ActiveSession = {place_id, game_job_id} / nil,
			ForceLoadSession = {place_id, game_job_id} / nil,
			MetaTags = {},
			LastUpdate = 0, -- os.time()
		},
		GlobalUpdates = {
			update_index,
			{
				{update_id, version_id, update_locked, update_data},
				...
			}
		},
	}
	
	OR
	
	DataStoreProfile = {
		GlobalUpdates = {
			update_index,
			{
				{update_id, version_id, update_locked, update_data},
				...
			}
		},
	}
--]]
-- Function to check if the given object should drop


local function checkIfShouldDrop(object, delta)

    -- Setup is in number of drops per minute; need to convert minutes to ticks
    local dropsPerSecond = object.NUMBER_PER_MINUTE / 60
    local ticksPerSecond = 1 / delta
    local dropsPerTick = dropsPerSecond / ticksPerSecond

    -- Calculate random chance
    local randomNumber = randomGenerator:NextNumber()
    return randomNumber < dropsPerTick
end
--Made by Luckymaxer



Model = script.Parent

Debris = game:GetService("Debris")

Removing = false

function RemoveModel()
	if Removing then
		return
	end
	local Parts = {}
	for i, v in pairs(Model:GetChildren()) do
		if v:IsA("Model") then
			table.insert(Parts, v)
		end
	end
	if #Parts == 0 then
		Removing = true
		Model.Name = ""
		Debris:AddItem(Model, 1)
	end
end

Model.ChildRemoved:connect(function(Child)
	RemoveModel()
end)

RemoveModel()