Are you sure this code is running at all? It has some obvious syntax errors...
Have you enabled your error messages?
Code:
/console scriptErrors 1
I think your
Code:
local Pet()
print("function)
end
should really be
Code:
local function Pet()
print("This is Pet()... or something.")
end
Furthermore, you are creating your frame as
f, but use the variable name
frame afterwards. This should throw an error, too.
Then you are using
frame:SetScript() for "OnEvent" twice.
The second script assignment will override the first.