(Solved) Uncaught TypeError: Cannot read properties of undefined (reading 'func')

Getting this error (pic related) because of that:

{gdjs.evtsExt__Clipboard__WriteText.func(runtimeScene, gdjs.evtTools.p2p.getCurrentId(), (typeof eventsFunctionContext !== 'undefined' ? eventsFunctionContext : undefined));
(this must write text in clipboard)

Keep in mind that the community extension for clipboard isn’t something part of the engine, so support is limited. However, I don’t believe the GetID Command returns a string. try to store it in a variable first then pass that to the clipboard

like this:

Oh okay I’m solved problem by using Clipboard::ReadText(). Thanks for reply anyway!

No. More like

Modify the text of scene variable "yourID": Set to ToString(P2P::GetID())
Write VariableString(yourID) to clipboard
Read clipboard and store text in blah

However if you’re getting the user’s current Id, you don’t really need the extra steps, and it probably just be

Write ToString(P2P:GetID()) to clipboard

I’m not sure your VariableString(id) is needed for this event, but you’d understand your events more than I do.

Thank you. You can close this issue

1 Like