Pointshop: Function multiple lines error

Hey, please help me! I am trying to make a item that does multiple things



function ITEM:OnBuy(ply)
    if ply:IsValid() then
    PrintMessage( HUD_PRINTTALK, "Look its " .. ply.GetName() .. " He just bought something? Wow" )
    elseif ply:Alive() then
    ply:PS_GiveItem('conehat')
    else end

I need help, it seems not to work. Like I want it the player buys it, receives it and a message is sent in chat? Help!

ply:Nick() instead of ply.GetName()


function ITEM:OnBuy(ply)
    if ply:IsValid() then
        PrintMessage( HUD_PRINTTALK, "Look its " .. ply:Nick() .. " He just bought something? Wow" )
        ply:PS_GiveItem('conehat')
    end
end


should work, didn’t test it.