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!

Hey

Try this:

feature.on('click', e => 
{
console.log(e.player.wallet)
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)

fetch('https://adm.cryptohodlers.io/api/v1/users/ownership/'+e.player.wallet)
).then(function(response) {
	allow = response
  console.log(allow)
}

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('https://adm.cryptohodlers.io/api/v1/users/ownership/'+ e.player.wallet)
.then(function(response) {
 if (response.ok) {
      e.player.teleportTo('W@866E,14N,6.5U')
    }
}))

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