Help using hasEthereumNFT function

Hi all, This is the very first time I try this function and I’m finding it a little hard to use.

feature.on('click', e => console.log(e.player.wallet)
player.hasEthereumNFT(0x7be8076f4ea4a4ad08075c2508e481d6c946d12b, , (hasNFT)=>player.teleportTo(E@866E,13N,6.5U))

As you can see I wanna telport all users that have one of the NFTs from my smart contract to a private room in the parcel.
The console tells me there’s some syntax problems here, and I honestly don’t know how to fill the tokenId field of the function because I should add 10.000 ids…
Is there a way to make that field optional?
And what else looks wrong in my code?
Thanks in advance!


Try this:

feature.on('click', e => 
player.hasEthereumNFT("0x7be8076f4ea4a4ad08075c2508e481d6c946d12b", 1, (hasNFT)=>player.teleportTo("E@866E,13N,6.5U"))

You do need to set the id of the token

Then I should probably use the collection’s API to check ownership, but the CV scripting engine keeps throwing syntax error to my fetch script (endpoint answers with boolean ture/false and works properly from the browser):

var allow = false
feature.on('click', e => console.log(e.player.wallet)

).then(function(response) {
	allow = response

Or maybe is possible to feed the tokenId field with an array?

Nevermind, I made it work with out API endpoint, this was the working code:

feature.on('click', e => 
fetch(''+ e.player.wallet)
.then(function(response) {
 if (response.ok) {

Thanks guys, hope this help some other dev!!!