Pinkstack/roblox-luau-corpus-text huggingface dataset:
--[[
    Indexes the avatar joints and gives them a default orientation
]]


function ClientAvatarComponent:setupJoints()
	self.shoulders = {}
	self.hips = {}
	self.knees = {}

	local leftShoulder = self.avatar:FindFirstChild("LeftShoulder", true)
	local rightShoulder = self.avatar:FindFirstChild("RightShoulder", true)
	local leftHip = self.avatar:FindFirstChild("LeftHip", true)
	local rightHip = self.avatar:FindFirstChild("RightHip", true)
	local leftKnee = self.avatar:FindFirstChild("LeftKnee", true)
	local rightKnee = self.avatar:FindFirstChild("RightKnee", true)

	-- Transform doesn't replicate, so this is applied clientside on each client
	-- As animations can't be shared between users yet, we can't use an animation for this

	if leftShoulder and leftShoulder:IsA("Motor6D") then
		leftShoulder.Transform = CFrame.Angles(0.3 * math.pi, 0, 0)
		self.shoulders.left = leftShoulder
	end
	if rightShoulder and rightShoulder:IsA("Motor6D") then
		rightShoulder.Transform = CFrame.Angles(0.3 * math.pi, 0, 0)
		self.shoulders.right = rightShoulder
	end
	if leftHip and leftHip:IsA("Motor6D") then
		leftHip.Transform = CFrame.Angles(0.5 * math.pi, 0, 0)
		self.hips.left = leftHip
	end
	if rightHip and rightHip:IsA("Motor6D") then
		rightHip.Transform = CFrame.Angles(0.5 * math.pi, 0, 0)
		self.hips.right = rightHip
	end
	if leftKnee and leftKnee:IsA("Motor6D") then
		leftKnee.Transform = CFrame.Angles(-0.5 * math.pi, 0, 0)
		self.knees.left = leftKnee
	end
	if rightKnee and rightKnee:IsA("Motor6D") then
		rightKnee.Transform = CFrame.Angles(-0.5 * math.pi, 0, 0)
		self.knees.right = rightKnee
	end
end
--Reset First


LeftHip.C1 = CFrame.new(3,0,0)
RightHip.C1 = CFrame.new(-3,0,0)

print("Completed")

while true do
	LeftHip.C1 = CFrame.new(3,0,0-5)
	RightHip.C1 = CFrame.new(-3,0,0+5)
	for i = 1,10 do
		LeftHip.C1 = LeftHip.C1 * CFrame.new(0,-0.5,0.5)
		RightHip.C1 = RightHip.C1 * CFrame.new(0,0.5,-0.5)
		--sp.Parent.Waist.CFrame = sp.Parent.Waist.CFrame * CFrame.new(0,0.5,0)
		--sp.Parent.Waist.RotVelocity = sp.Parent.Waist.RotVelocity * Vector3.new(1,0,1)
		wait()
	end
	for i = 1,10 do
		LeftHip.C1 = LeftHip.C1 * CFrame.new(0,0.5,0.5)
		RightHip.C1 = RightHip.C1 * CFrame.new(0,-0.5,-0.5)
		--sp.Parent.Waist.CFrame = sp.Parent.Waist.CFrame * CFrame.new(0,-0.5,0)
		--sp.Parent.Waist.RotVelocity = sp.Parent.Waist.RotVelocity * Vector3.new(1,0,1)
		wait()
	end
	sp.Parent.Torso["Footstep"..math.random(1,3)]:Play()
	for i = 1,10 do
		LeftHip.C1 = LeftHip.C1 * CFrame.new(0,0.5,-0.5)
		RightHip.C1 = RightHip.C1 * CFrame.new(0,-0.5,0.5)
		--sp.Parent.Waist.CFrame = sp.Parent.Waist.CFrame * CFrame.new(0,0.5,0)
		--sp.Parent.Waist.RotVelocity = sp.Parent.Waist.RotVelocity * Vector3.new(1,0,1)
		wait()
	end
	for i = 1,10 do
		LeftHip.C1 = LeftHip.C1 * CFrame.new(0,-0.5,-0.5)
		RightHip.C1 = RightHip.C1 * CFrame.new(0,0.5,0.5)
		--sp.Parent.Waist.CFrame = sp.Parent.Waist.CFrame * CFrame.new(0,-0.5,0)
		--sp.Parent.Waist.RotVelocity = sp.Parent.Waist.RotVelocity * Vector3.new(1,0,1)
		wait()
	end
	sp.Parent.Torso["Footstep"..math.random(1,3)]:Play()
end
--[[if player and player.Parent:findFirstChild("Humanoid") then
local enemy = game.Players:findFirstChild(player.Parent.Name)
if enemy then
if enemy.TeamColor ~= pler.TeamColor then
if player.Parent:findFirstChild("Head") and not pler.PlayerGui:findFirstChild(player.Parent.Name) then

local big = Instance.new("BillboardGui",pler.PlayerGui)
big.Name = player.Parent.Name
big.Adornee = player.Parent:findFirstChild("Head")
big.Size = UDim2.new( 1.0, 0, 1.0, 0 )
big.StudsOffset = Vector3.new( 0, 2, 0 )

local name = Instance.new("TextLabel",big)
name.Position = UDim2.new( 0.5, 0, 0, 0 )
name.FontSize = 3
name.BackgroundTransparency = 1
name.Size = UDim2.new(0, 0, 0, 0 )
name.Text = player.Parent.Name
name.TextColor3 = Color3.new(25, 0, 0)

game.Debris:AddItem(big,1)

end
end
end
end]]


end
end
function on(mouse)
while true do
wait(.5)
Run(mouse)
end
end

Tool.Equipped:connect(on)
--[=[
	Observes all descendants that match a predicate

	@param parent Instance
	@param predicate ((value: Instance) -> boolean)? -- Optional filter
	@return Observable<Instance, boolean>
]=]


function RxInstanceUtils.observeDescendants(parent, predicate)
	assert(typeof(parent) == "Instance", "Bad parent")
	assert(type(predicate) == "function" or predicate == nil, "Bad predicate")

	return Observable.new(function(sub)
		local maid = Maid.new()
		local added = {}

		local function handleDescendant(child)
			if not predicate or predicate(child) then
				added[child] = true
				sub:Fire(child, true)
			end
		end

		maid:GiveTask(parent.DescendantAdded:Connect(handleDescendant))
		maid:GiveTask(parent.DescendantRemoving:Connect(function(child)
			if added[child] then
				added[child] = nil
				sub:Fire(child, false)
			end
		end))

		for _, descendant in pairs(parent:GetDescendants()) do
			handleDescendant(descendant)
		end

		return maid
	end)
end
--[=[
	@tag Component Instance
	@param componentClass ComponentClass
	@return Component?

	Retrieves another component instance bound to the same
	Roblox instance.

	```lua
	local MyComponent = Component.new({Tag = "MyComponent"})
	local AnotherComponent = require(somewhere.AnotherComponent)

	function MyComponent:Start()
		local another = self:GetComponent(AnotherComponent)
	end
	```
]=]


function Component:GetComponent(componentClass)
	return componentClass[KEY_INST_TO_COMPONENTS][self.Instance]
end
--[[
	Allows creation of expectation statements designed for behavior-driven
	testing (BDD). See Chai (JS) or RSpec (Ruby) for examples of other BDD
	frameworks.

	The Expectation class is exposed to tests as a function called `expect`:

		expect(5).to.equal(5)
		expect(foo()).to.be.ok()

	Expectations can be negated using .never:

		expect(true).never.to.equal(false)

	Expectations throw errors when their conditions are not met.
]]



local Expectation = {}
--[=[
	Observes the parent of the instance as long as it exists. This is very common when
	initializing parent interfaces or other behaviors using binders.

	@param instance Instance
	@return Observable<Brio<Instance>>
]=]


function RxInstanceUtils.observeParentBrio(instance)
	return RxInstanceUtils.observePropertyBrio(instance, "Parent", function(parent)
		return parent ~= nil
	end)
end
-- Determines which spawners will actively spawn enemies based off the waypoint (attachments in Workspace.TrackParts), the cart is currently at


local EnemySpawning = {}

local waypoints = {}

waypoints[1] = { "Spawner1", "Spawner2", "Spawner6", "Spawner7" }
waypoints[2] = { "Spawner2", "Spawner3", "Spawner4", "Spawner5" }
waypoints[3] = { "Spawner2", "Spawner5", "Spawner6", "Spawner7" }
waypoints[4] = { "Spawner2", "Spawner3", "Spawner5", "Spawner6", "Spawner7" }
waypoints[5] = {}
waypoints[6] = { "Spawner8", "Spawner9", "Spawner12", "Spawner17" }
waypoints[7] = { "Spawner10", "Spawner11", "Spawner12", "Spawner17" }
waypoints[8] = { "Spawner10", "Spawner11", "Spawner13", "Spawner14" } 
waypoints[9] = { "Spawner8", "Spawner10", "Spawner12", "Spawner14" } 
waypoints[10] = { "Spawner8", "Spawner9", "Spawner11", "Spawner14" } 
waypoints[11] = { "Spawner15", "Spawner16", "Spawner18", "Spawner13"}
waypoints[12] = { "Spawner15", "Spawner16", "Spawner19", "Spawner20" } 

EnemySpawning.waypoints = waypoints

return EnemySpawning
-- place this script under the gui object you want to rotate and use the rotation and speed value to change the rotation (degrees) and speed (seconds for full loop)



local RunService = game:GetService("RunService")
function slerp(a,b,x)
	return a*(((1+(math.cos(x*math.pi)))/2)) + b*(((1-(math.cos(x*math.pi)))/2))
end

local object = script.Parent
local count = 0.0
local rotation = object.Rotation	

RunService.Heartbeat:Connect(function(step)
	count += step / script.speed.Value * 2
	if step <= 1 then
		object.Rotation = slerp(-script.rotation.Value,script.rotation.Value,count)+rotation
	else if step <= 2 then
			object.Rotation = slerp(script.rotation.Value,-script.rotation.Value,count)+rotation
		else
			count = 0
		end
	end
end)
--- Takes an array of arguments and a max value.
-- Any indicies past the max value will be appended to the last valid argument.


function Util.MashExcessArguments(arguments, max)
	local t = {}
	for i = 1, #arguments do
		if i > max then
			t[max] = ("%s %s"):format(t[max] or "", arguments[i])
		else
			t[i] = arguments[i]
		end
	end
	return t
end
--[[Engine]]


	--Torque Curve
	Tune.Horsepower		= 500		--	[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)
--------------------------------------------------


script.Parent.Values.RPM.Changed:connect(function()
	intach.Rotation = -80 + script.Parent.Values.RPM.Value * 240 / 8000
end)

script.Parent.Values.Velocity.Changed:connect(function(property)
	inspd.Rotation = -30 + (440 / 160) * (math.abs(script.Parent.Values.Velocity.Value.Magnitude*((6/12) * (50/88))))
end)

if _Tune.Aspiration ~= "Natural" then 
	if _Tune.Aspiration == "Single" then 
		_TCount = 1 
	elseif _Tune.Aspiration == "Double" then 
		_TCount = 2 
	end
	script.Parent.Values.Boost.Changed:connect(function()
		local boost = (math.floor(script.Parent.Values.Boost.Value)*1.2)-((_Tune.Boost*_TCount)/5)
		inbst.Rotation = -30 + 61 * math.min(1,(script.Parent.Values.Boost.Value/(_Tune.Boost)/_TCount))
	end)
end
--[[ By: Brutez. ]]

--
local CameraRotateScript=script;
local Camera=CameraRotateScript.Parent;
while true do
for RotateRight=1,100 do
Camera.CFrame=Camera.CFrame*CFrame.fromEulerAnglesXYZ(0,math.rad(-0.5),0)
wait(0)
end
wait(2)
for RotateLeft=1,100 do
Camera.CFrame=Camera.CFrame*CFrame.fromEulerAnglesXYZ(0,math.rad(0.5),0)
wait(0)
end
wait(2)
end
--if SignalValues.Signal1.Value == 1 then
--	SignalValues.Signal1.Value = 2
--end
--if SignalValues.Signal1a.Value == 1 then
--	SignalValues.Signal1a.Value = 2
--end
--if SignalValues.Signal2.Value == 1 then
--	SignalValues.Signal2.Value = 2
--end
--if SignalValues.Signal2a.Value == 1 then
--	SignalValues.Signal2a.Value = 2
--end
--if TurnValues.TurnSignal1.Value == 1 then
--	TurnValues.TurnSignal1.Value = 2
--end
--if TurnValues.TurnSignal1a.Value == 1 then
--	TurnValues.TurnSignal1a.Value = 2
--end
--if TurnValues.TurnSignal2.Value == 1 then
--	TurnValues.TurnSignal2.Value = 2
--end
--if TurnValues.TurnSignal2a.Value == 1 then
--	TurnValues.TurnSignal2a.Value = 2
--end
--if PedValues.PedSignal1.Value == 1 then
--	PedValues.PedSignal1.Value = 2
--end
--if PedValues.PedSignal1a.Value == 1 then
--	PedValues.PedSignal1a.Value = 2
--end
--if PedValues.PedSignal2.Value == 1 then
--	PedValues.PedSignal2.Value = 2
--end
--if PedValues.PedSignal2a.Value == 1 then
--	PedValues.PedSignal2a.Value = 2
--end
--script.Parent.ScreenGui.Parent = game.ServerStorage



script.Parent.Equipped:Connect(function(Hit)
	script.Parent.Hand.Equip:Play()
	
	
	if script.Parent.Configuration.HasAbility.Value == true then
			script.Parent.AbilityServer.Disabled = false
	script.Parent.Ability.Disabled = false
	player = game.Players:GetPlayerFromCharacter(script.Parent.Parent)
	Mobile = script.Parent.MobileGui:Clone()
	
	Mobile.Parent = player.PlayerGui

	end
end)

script.Parent.Unequipped:Connect(function(Hit2)
	script.Parent.Hand.Equip:Stop()
	
	if script.Parent.Configuration.HasAbility.Value == true then
			script.Parent.AbilityServer.Disabled = true
	script.Parent.Ability.Disabled = true
	Mobile:Destroy()

	end
end)
-- Initialize the tool


local RotateTool = {
	Name = 'Rotate Tool';
	Color = BrickColor.new 'Bright green';

	-- Default options
	Increment = 15;
	Pivot = 'Center';
}

RotateTool.ManualText = [[<font face="GothamBlack" size="16">Rotate Tool  🛠</font>
Allows you to rotate parts.<font size="12"><br /></font>
<font size="12" color="rgb(150, 150, 150)"><b>Pivot</b></font>
This option lets you choose what to rotate the parts around.<font size="6"><br /></font>
 <font color="rgb(150, 150, 150)">•</font>  <b>CENTER</b> <font color="rgb(150, 150, 150)">—</font> Relative to the <b>center of the selection</b>
 <font color="rgb(150, 150, 150)">•</font>  <b>LOCAL</b> <font color="rgb(150, 150, 150)">—</font> Each part around its <b>own center</b>
 <font color="rgb(150, 150, 150)">•</font>  <b>LAST</b> <font color="rgb(150, 150, 150)">—</font> Relative to the <b>center of the last part clicked</b><font size="6"><br /></font>

<b>TIP:</b> Click on any part to focus the handles on it.<font size="6"><br /></font>
<b>TIP: </b>Hit the <b>Enter</b> key to switch between Pivot modes quickly.<font size="12"><br /></font>

<font size="12" color="rgb(150, 150, 150)"><b>Increment</b></font>
Lets you choose how many degrees to rotate by.<font size="6"><br /></font>

<b>TIP: </b>Hit the – key to quickly type increments.<font size="6"><br /></font>

<b>TIP: </b>Use your number pad to rotate exactly by the current increment. Holding <b>Shift</b> reverses the increment.<font size="4"><br /></font>
   <font color="rgb(150, 150, 150)">•</font>  4 & 6 — Y axis (green)
   <font color="rgb(150, 150, 150)">•</font>  1 & 9 — Z axis (blue)
   <font color="rgb(150, 150, 150)">•</font>  2 & 8 — X axis (red)<font size="12"><br /></font>

<font size="12" color="rgb(150, 150, 150)"><b>Snapping</b></font>
Press <b><i>R</i></b> and click on a part's <b>snap point</b> to rotate around it.
]]
-- setup emote chat hook


game.Players.LocalPlayer.Chatted:connect(function(msg)
	local emote = ""
	if msg == "/e dance" then
		emote = dances[math.random(1, #dances)]
	elseif (string.sub(msg, 1, 3) == "/e ") then
		emote = string.sub(msg, 4)
	elseif (string.sub(msg, 1, 7) == "/emote ") then
		emote = string.sub(msg, 8)
	end
	
	if (pose == "Standing" and emoteNames[emote] ~= nil) then
		playAnimation(emote, 0.1, Humanoid)
	end

end)
--[[ ROBLOX TODO: Unhandled node for type: TSIndexedAccessType ]]
--[[ export const serialize: NewPlugin['serialize'] ]]


local function serialize(
	element: any,
	config: Config,
	indentation: string,
	depth: number,
	refs: Refs,
	printer: Printer
): string
	depth += 1
	return if depth > config.maxDepth
		then printElementAsLeaf(getType(element), config)
		else printElement(
			getType(element),
			printProps(getPropKeys(element), element.props, config, indentation .. config.indent, depth, refs, printer),
			printChildren(
				getChildren(element.props.children),
				config,
				indentation .. config.indent,
				depth,
				refs,
				printer
			),
			config,
			indentation
		)
end

exports.serialize = serialize
-- Error handler


function red.error(err)
	print(err)
end

red.remotes = RunService:IsClient() and
	ReplicatedStorage:WaitForChild(Constants.remoteFolderName) or
	ReplicatedStorage:FindFirstChild(Constants.remoteFolderName)

if not red.remotes then
	-- Container for remotes
	red.remotes = Instance.new('Folder')
	red.remotes.Name = Constants.remoteFolderName
	
	-- store:dispatch() calls from client to server and server to client
	local client = Instance.new('RemoteEvent')
	client.Name = 'Client'
	client.Parent = red.remotes
	
	-- store:dispatch() calls from server to server
	local server = Instance.new('BindableEvent')
	server.Name = 'Server'
	server.Parent = red.remotes
	
	red.remotes.Parent = ReplicatedStorage
end

return Util.extend(red, {
	Server = require(script.Server),
	State = require(script.State),
	Store = require(script.Store)
})
--This is the server sided module for handling this vehicles seating requests


local Players = game:GetService("Players")
local Workspace = game:GetService("Workspace")
local HttpService = game:GetService("HttpService")
local CollectionService = game:GetService("CollectionService")

local DOOR_OPEN_SPEED = 2.15
local DOOR_OPEN_ANGLE = 55
local DOOR_OPEN_TIME = 0.5 --How long the door stays open for when entering/leaving

local MAX_SEATING_DISTANCE = 15

local RemotesFolder = nil --Set later in the code by the SetRemotesFolder function
	
local SeatTag = "Seat_" ..HttpService:GenerateGUID()
--TheNexusAvenger
--Runs the rocket projectile.



local Configuration = require(script:WaitForChild("Configuration"))

local FORCE_GRANULARITY = Configuration.FORCE_GRANULARITY
local BLAST_RADIUS = Configuration.BLAST_RADIUS
local BLAST_PRESSURE = Configuration.BLAST_PRESSURE * FORCE_GRANULARITY
local ROCKET_DECAY_TIME = Configuration.ROCKET_DECAY_TIME
local MAX_DAMAGE = Configuration.MAX_DAMAGE
local MIN_DAMAGE = Configuration.MIN_DAMAGE
local IGNORE_LIST = Configuration.IGNORE_LIST



local Rocket = script.Parent
local SwooshSound = Rocket:WaitForChild("SwooshSound")

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

local ExplodeEvent = Instance.new("RemoteEvent")
ExplodeEvent.Name = "Explode"
ExplodeEvent.Parent = Rocket

local PlayerDamager = require(script:WaitForChild("PlayerDamager"))
local FiredByValue = Rocket:WaitForChild("FiredBy",10^99)
while FiredByValue.Value == nil do FiredByValue.Changed:Wait() end

local FiredPlayer = FiredByValue.Value
local FiredCharacter = FiredPlayer.Character
local Exploded = false

SwooshSound:Play()
Debris:AddItem(Rocket,ROCKET_DECAY_TIME)

for Key,Value in pairs(IGNORE_LIST) do
	if type(Key) == "string" then
		IGNORE_LIST[string.lower(Key)] = Value
	end
end
--[[ Local Functions ]]

--
function MouseLockController:OnMouseLockToggled()
	self.isMouseLocked = not self.isMouseLocked

	if self.isMouseLocked then
		local cursorImageValueObj: StringValue = script:FindFirstChild("CursorImage") :: StringValue
		if cursorImageValueObj and cursorImageValueObj:IsA("StringValue") and cursorImageValueObj.Value then
			self.savedMouseCursor = Mouse.Icon
			Mouse.Icon = cursorImageValueObj.Value
		else
			if cursorImageValueObj then
				cursorImageValueObj:Destroy()
			end
			cursorImageValueObj = Instance.new("StringValue")
			cursorImageValueObj.Name = "CursorImage"
			cursorImageValueObj.Value = DEFAULT_MOUSE_LOCK_CURSOR
			cursorImageValueObj.Parent = script
			self.savedMouseCursor = Mouse.Icon
			Mouse.Icon = DEFAULT_MOUSE_LOCK_CURSOR
		end
	else
		if self.savedMouseCursor then
			Mouse.Icon = self.savedMouseCursor
			self.savedMouseCursor = nil
		end
	end

	self.mouseLockToggledEvent:Fire()
end

function MouseLockController:DoMouseLockSwitch(name, state, input)
	if state == Enum.UserInputState.Begin then
		self:OnMouseLockToggled()
		return Enum.ContextActionResult.Sink
	end
	return Enum.ContextActionResult.Pass
end

function MouseLockController:BindContextActions()
	ContextActionService:BindActionAtPriority(CONTEXT_ACTION_NAME, function(name, state, input)
		return self:DoMouseLockSwitch(name, state, input)
	end, false, MOUSELOCK_ACTION_PRIORITY, unpack(self.boundKeys))
end

function MouseLockController:UnbindContextActions()
	ContextActionService:UnbindAction(CONTEXT_ACTION_NAME)
end

function MouseLockController:IsMouseLocked(): boolean
	return self.enabled and self.isMouseLocked
end

function MouseLockController:EnableMouseLock(enable: boolean)
	if enable ~= self.enabled then

		self.enabled = enable

		if self.enabled then
			-- Enabling the mode
			self:BindContextActions()
		else
			-- Disabling
			-- Restore mouse cursor
			if Mouse.Icon~="" then
				Mouse.Icon = ""
			end

			self:UnbindContextActions()

			-- If the mode is disabled while being used, fire the event to toggle it off
			if self.isMouseLocked then
				self.mouseLockToggledEvent:Fire()
			end

			self.isMouseLocked = false
		end

	end
end

return MouseLockController
-- ANimation


local Sound = script:WaitForChild("Haoshoku Sound")

UIS.InputBegan:Connect(function(Input)
	if Input.KeyCode == Enum.KeyCode.Z and Debounce == 1 and Tool.Equip.Value == true and Tool.Active.Value == "None" and energy.Value > 12 then
		Debounce = 2
		Track1 = plr.Character.Humanoid:LoadAnimation(script.AnimationCharge)
		Track1:Play()
		script.RemoteEventS:FireServer()
		for i = 1,math.huge do
			if Debounce == 2 then
				
				plr.Character.HumanoidRootPart.CFrame = CFrame.new(plr.Character.HumanoidRootPart.Position, Mouse.Hit.p)
				plr.Character.HumanoidRootPart.Anchored = true
			else
				
				break
				end
	     wait()
	  end
	end
end)

UIS.InputEnded:Connect(function(Input)
	if Input.KeyCode == Enum.KeyCode.Z and Debounce == 2 and Tool.Equip.Value == true and Tool.Active.Value == "None" then
		Debounce = 3
		local Track2 = plr.Character.Humanoid:LoadAnimation(script.AnimationRelease)
		Track2:Play()
		Track1:Stop()
		Sound:Play()
		local mousepos = Mouse.Hit
		script.RemoteEvent:FireServer(mousepos,Mouse.Hit.p)
		wait(1)
		Track2:Stop()
		plr.Character.HumanoidRootPart.Anchored = false
		wait(.5)
		Tool.Active.Value = "None"
		wait(3)
		Debounce = 1
	end
end)
-- a single button script :p



local THEbutton = script.Parent.Button
local CD = Instance.new("ClickDetector",THEbutton)
CD.MaxActivationDistance = 5

local deb = false
local TS = game:GetService("TweenService")
local og_pos = THEbutton.CFrame
CD.MouseClick:Connect(function()
	if not deb then
		deb = true
		local start = TS:Create(THEbutton,TweenInfo.new(.1,Enum.EasingStyle.Quad,Enum.EasingDirection.In,0,false,0),{CFrame = og_pos* CFrame.new(-.03,0,0)})
		start.Completed:Connect(function()
			local End = TS:Create(THEbutton,TweenInfo.new(.1,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut,0,false,0),{CFrame = og_pos})
			End.Completed:Connect(function()
				deb = false
			end)
			End:Play()
		end)
		start:Play()
	end
end)
--returns the wielding player of this tool


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

function Toss(direction)
	local OriginalWalkSpeed = Humanoid.WalkSpeed
	OriginalWalkSpeed = OriginalWalkSpeed
	Humanoid.WalkSpeed = 0
	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 = 0
	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.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.FriendlyFire.Value = FriendlyFire
	ScriptClone.Damage.Value = AttackDamage
	ScriptClone.Parent = Object
	ScriptClone.Disabled = false
	local tag = Instance.new("ObjectValue")
	tag.Value = getPlayer()
	tag.Name = "creator"
	tag.Parent = Object
	Humanoid.WalkSpeed = OriginalWalkSpeed
	Tool:Destroy()
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)