Roblox/luau_corpus huggingface dataset:
-------------------------------------------------------------------------

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
-- Decompiled with the Synapse X Luau decompiler.

client = nil;
cPcall = nil;
Pcall = nil;
Routine = nil;
service = nil;
return function(p1)
	local v1 = client.UI.Prepare(script.Parent.Parent);
	local l__PlayerGui__2 = service.PlayerGui;
	local l__Frame__3 = v1.Frame;
	local l__Message__4 = v1.Frame.Message;
	local l__Title__5 = v1.Frame.Title;
	local l__gIndex__6 = p1.gIndex;
	local l__Title__7 = p1.Title;
	local l__Message__8 = p1.Message;
	local l__Scroll__9 = p1.Scroll;
	if not p1.Message or not p1.Title then
		v1:Destroy();
	end;
	l__Title__5.Text = l__Title__7;
	l__Message__4.Text = l__Message__8;
	l__Title__5.TextTransparency = 1;
	l__Message__4.TextTransparency = 1;
	l__Title__5.TextStrokeTransparency = 1;
	l__Message__4.TextStrokeTransparency = 1;
	l__Frame__3.BackgroundTransparency = 1;
	local v10 = {
		Type = "Full Screen Message", 
		Title = l__Title__7, 
		Message = l__Message__8, 
		Icon = "rbxassetid://7501175708", 
		Time = os.date("%X"), 
		Function = nil
	};
	table.insert(client.Variables.CommunicationsHistory, v10);
	service.Events.CommsCenter:Fire(v10);
	local v11 = service.New("BlurEffect");
	v11.Enabled = false;
	v11.Size = 0;
	v11.Parent = workspace.CurrentCamera;
	local u1 = false;
	local l__gTable__2 = p1.gTable;
	local function u3()
		if not u1 then
			for v12 = 1, 10 do
				if v11.Size > 0 then
					v11.Size = v11.Size - 1;
				end;
				if l__Message__4.TextTransparency < 1 then
					l__Message__4.TextTransparency = l__Message__4.TextTransparency + 0.1;
					l__Title__5.TextTransparency = l__Title__5.TextTransparency + 0.1;
				end;
				if l__Message__4.TextStrokeTransparency < 1 then
					l__Message__4.TextStrokeTransparency = l__Message__4.TextStrokeTransparency + 0.1;
					l__Title__5.TextStrokeTransparency = l__Title__5.TextStrokeTransparency + 0.1;
				end;
				if l__Frame__3.BackgroundTransparency < 1 then
					l__Frame__3.BackgroundTransparency = l__Frame__3.BackgroundTransparency + 0.03;
				end;
				wait(0.016666666666666666);
			end;
			v11.Enabled = false;
			v11:Destroy();
			service.UnWrap(v1):Destroy();
			u1 = true;
		end;
	end;
	function l__gTable__2.CustomDestroy()
		if not u1 then
			u1 = true;
			pcall(u3);
		end;
		pcall(function()
			service.UnWrap(v1):Destroy();
		end);
		pcall(function()
			v11:Destroy();
		end);
	end;
	(function()
		if not u1 then
			v11.Enabled = true;
			l__gTable__2:Ready();
			for v13 = 1, 10 do
				if v11.Size < 10 then
					v11.Size = v11.Size + 1;
				end;
				if l__Message__4.TextTransparency > 0.1 then
					l__Message__4.TextTransparency = l__Message__4.TextTransparency - 0.1;
					l__Title__5.TextTransparency = l__Title__5.TextTransparency - 0.1;
				end;
				if l__Message__4.TextStrokeTransparency > 0.5 then
					l__Message__4.TextStrokeTransparency = l__Message__4.TextStrokeTransparency - 0.1;
					l__Title__5.TextStrokeTransparency = l__Title__5.TextStrokeTransparency - 0.1;
				end;
				if l__Frame__3.BackgroundTransparency > 0.3 then
					l__Frame__3.BackgroundTransparency = l__Frame__3.BackgroundTransparency - 0.03;
				end;
				wait(0.016666666666666666);
			end;
		end;
	end)();
	wait(p1.Time and 5);
	if not u1 then
		u3();
	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)
-- Tween service reference
local TweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(0.3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
--[=[
	Utility functions involving attributes.
	@class RxAttributeUtils
]=]

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

local Observable = require("Observable")
local Maid = require("Maid")

local RxAttributeUtils = {}
--[=[
	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
--[[**
	ensures Roblox Color3 type

	@param value The value to check against

	@returns True iff the condition is satisfied, false otherwise
**--]]
t.Color3 = t.typeof("Color3")
--[[ 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)
-- Local Variables
local IntermissionRunning = false
local EnoughPlayers = false
local GameRunning = false
local Events = game.ReplicatedStorage.Events
----------------------------------------

local Grenade = script.Parent
local GrenadeScript = WaitFor(Grenade).GrenadeScript()
local Creator = WaitFor(GrenadeScript).creator().Value
local ExplodeSound = WaitFor(Grenade).ExplodeSound()
local Character = Creator.Character
--[[
	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
-- Roact
local new = Roact.createElement
local SelectionButton = require(script.Parent:WaitForChild('SelectionButton'))
-- 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
---
local  Paint = false
	
script.Parent.MouseButton1Click:connect(function()
	Paint = not Paint
	handler:FireServer("PBG",Paint)
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)
-- Local Functions
function OnCaptureFlag(player)
	PlayerManager:AddPlayerScore(player, 1)
	TeamManager:AddTeamScore(player.TeamColor, 1)
	DisplayManager:DisplayNotification(player.TeamColor, 'Captured Flag!')
end

local function OnReturnFlag(flagColor)
	DisplayManager:DisplayNotification(flagColor, 'Flag Returned!')
end
-- tween the sound to the speed

if speed > 0.01 and not walk.IsPlaying then
print("play walk")
walk:Play()
elseif speed <0.01 and walk.IsPlaying then
print("stop walk")
walk:Stop()
end
end
-- Make sure tools' icons update
for i,v in pairs(SlotsFolder:GetChildren()) do
	setIcon(v)
	
	v.Changed:connect(function()
		setIcon(v)
	end)
end