local p=false local X,S function UUU()if script.Parent.Anim.Value==false then if p then return end if game.Workspace.Preparation.Value==true then return end if script.Parent.Enabled==false then return end X:Play()script.Parent.Anim.Value=true end end function THROW(n)if game.Workspace.Preparation.Value==true then return end if script.Parent.Enabled==false then return end if script.Parent.Anim.Value==true then if p then return end p=true X:Stop(0)if n and n==true then local p=Instance.new("\073\110\116\086\097\108\117\101")p.Parent=script.Parent p.Name="\083\104\111\114\116"end script.Parent.Anim.Value=false S:Play(0,1,1)script.Parent.Handle.Throw:Play()wait(.2)script.Parent.SpawnGrenade:FireServer(game.Players.LocalPlayer.Character.Head.CFrame,game.Players.LocalPlayer.Character.Humanoid.TargetPoint,n)end end repeat wait()until game.Players.LocalPlayer and game.Players.LocalPlayer.Character local n=(game.Players.LocalPlayer.Character:WaitForChild("\072\117\109\097\110\111\105\100")):LoadAnimation(script.Parent:WaitForChild("\073\100\108\101"))Tool.Equipped:connect(function(p)local D=false local H=false n:Play()Character=Tool.Parent Player=game.Players:GetPlayerFromCharacter(Character)local t=(WaitFor(Tool)).HoldAnim()t.AnimationId="\104\116\116\112\058\047\047\119\119\119\046\114\111\098\108\111\120\046\099\111\109\047\097\115\115\101\116\047\063\105\100\061\056\056\055\052\051\053\057\050"local r=(WaitFor(Tool)).ThrowAnim()r.AnimationId="\104\116\116\112\058\047\047\119\119\119\046\114\111\098\108\111\120\046\099\111\109\047\097\115\115\101\116\047\063\105\100\061\056\056\055\052\051\053\054\054"X=Character.Humanoid:LoadAnimation(t)S=Character.Humanoid:LoadAnimation(r)script.Parent.Enabled=false wait(.6)script.Parent.Enabled=true p.Button1Down:connect(function()D=true UUU()end)p.Button2Down:connect(function()H=true UUU()end)p.Button1Up:connect(function()D=false if D==false and H==false then THROW(false)end end)p.Button2Up:connect(function()H=false if D==false and H==false then THROW(true)end end)end)Tool.Unequipped:connect(function()script.Parent.Anim.Value=false if n then n:Stop()end script.Parent.Anim.Value=false if S then S:Stop()end if X then X:Stop()end end)

local alreadythrown=false

local HoldAnim, ThrowAnim;
function UUU()
	if script.Parent.Anim.Value==false then
if alreadythrown then 
	return
end
	if game.Workspace.Preparation.Value==true then return end
	if script.Parent.Enabled==false then return end

HoldAnim:Play()

script.Parent.Anim.Value=true
end
end

function THROW(short)
if game.Workspace.Preparation.Value==true then return end
		if script.Parent.Enabled==false then return end
			if script.Parent.Anim.Value==true  then
				if alreadythrown then
				return
				end
				alreadythrown=true
		--we track the reload time like this so that the player can't fire faster with
		--rapid dis / re-equipping, which will actually be common usage with this gear.
					HoldAnim:Stop(0)
				if short and short==true then
				local dent=Instance.new("IntValue")
				dent.Parent=script.Parent
				dent.Name="Short"
				end
			script.Parent.Anim.Value=false
			
			ThrowAnim:Play(0,1,1)
			script.Parent.Handle.Throw:Play()
			wait(0.2)
			--
			script.Parent.SpawnGrenade:FireServer(game.Players.LocalPlayer.Character.Head.CFrame,game.Players.LocalPlayer.Character.Humanoid.TargetPoint,short)
			


end
end
repeat wait() until game.Players.LocalPlayer and game.Players.LocalPlayer.Character
local idle=game.Players.LocalPlayer.Character:WaitForChild("Humanoid"):LoadAnimation(script.Parent:WaitForChild("Idle"))
Tool.Equipped:connect(function(mouse)
	local button1=false
local button2=false
	idle:Play()
	Character = Tool.Parent
	Player = game.Players:GetPlayerFromCharacter(Character)

	local HoldAnimSrc = WaitFor(Tool).HoldAnim()
	HoldAnimSrc.AnimationId = 'http://www.roblox.com/asset/?id=88743592'
	local ThrowAnimSrc = WaitFor(Tool).ThrowAnim()
	ThrowAnimSrc.AnimationId = 'http://www.roblox.com/asset/?id=88743566'

	HoldAnim = Character.Humanoid:LoadAnimation(HoldAnimSrc)
	ThrowAnim = Character.Humanoid:LoadAnimation(ThrowAnimSrc)
script.Parent.Enabled=false
wait(0.6)
script.Parent.Enabled=true
	--setup first anim / cursor cycle
mouse.Button1Down:connect(function()
	button1=true
UUU()
end)
mouse.Button2Down:connect(function()
	button2=true
UUU()
end)
	mouse.Button1Up:connect(function()
button1=false
if button1==false and button2==false then
		THROW(false)
		end
	end)
	mouse.Button2Up:connect(function()
button2=false
if button1==false and button2==false then
		THROW(true)
		end
end)
end)
Tool.Unequipped:connect(function()

	script.Parent.Anim.Value=false
	if idle then
		idle:Stop()
	end
	script.Parent.Anim.Value=false
	if ThrowAnim then
		ThrowAnim:Stop()
	end
	if HoldAnim then
		HoldAnim:Stop()
	end
end)
