Okay I have created this script and it's working.
local coffee = script.Parent.Parent
local function OnMouseClick(Player)
while true do
coffee = script.Parent.Parent
if Player == nil then return end
coffee = game.ServerStorage.IceCoffee:Clone()
if Player.Backpack:FindFirstChild(coffee.Name) ~= nil then return end
coffee.Parent = Player.Backpack
print("Enjoy your coffee!")
end
end
script.Parent.MouseClick:connect(OnMouseClick)
But it only will let you click it once per life. I was wondering how I could fix this.

2 comments
You don't know? Just take out the if statement on line 07.
Thanks for the help percil I forgot about adding it I didn't pay attention to it!