--[[ http://coffeescript.org/ ]]
 --
local coffee = script.Parent;
local drinking = false

coffee.Equipped:connect(function()
	coffee.Handle.OpenSound:Play()
end)

coffee.Activated:connect(function()
	if drinking then
		return
	end

	drinking = true
	coffee.GripForward = Vector3.new(0,-1,0)
	coffee.GripPos = Vector3.new(1.5,.85,-.15)
	coffee.GripRight = Vector3.new(1,0,0)
	coffee.GripUp = Vector3.new(0,0,1)

	coffee.Handle.DrinkSound:Play()

	wait(1)
	
	coffee.Parent.Humanoid.Health = coffee.Parent.Humanoid.Health + 100
	restPos()

	drinking = false
end)

coffee.Unequipped:connect(function()
	restPos()
	coffee.Handle.DrinkSound:Stop()
	drinking = false
end)

function restPos()
	coffee.GripForward = Vector3.new(0,-1,0)
	coffee.GripPos = Vector3.new(0,0.15,-0.3)
	coffee.GripRight = Vector3.new(-1,0,0)
	coffee.GripUp = Vector3.new(0,0,1)
end
