Hello!
So I know that Roblox updated how GamePassService works, and I've been using one of their teleport models for ages, that worked just fine until the latest update. I thought I'd fixed my code here with the new terms, but I'm getting this error for Line 37 "Unable to cast string to int64" What is this? I've never seen this, and am unsure how to correct it.
Script below:
01 | -------------------- |
02 | --| WaitForChild |-- |
03 | -------------------- |
04 |
05 | -- Waits for parent.child to exist, then returns it |
06 | local function WaitForChild(parent, childName) |
07 | assert (parent, "ERROR: WaitForChild: parent is nil" ) |
08 | while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end |
09 | return parent [ childName ] |
10 | end |
11 |
12 | ----------------- |
13 | --| Variables |-- |
14 | ----------------- |
15 |
1 | if game:GetService( "MarketplaceService" ):UserOwnsGamePassAsync(player, GamePassIdObject) then |
MarketplaceService:UserOwnsGamePassAsync()
takes two arguments, firstly, the player's User ID, and secondly an integer of the game pass ID to test ownership for.
http://wiki.roblox.com/index.php?title=API:Class/MarketplaceService/UserOwnsGamePassAsync
Also:
local GamePassIdObject = "rbxassetid://879190380"
You may be looking for this instead:
local GamePassIdObject = 879190380