Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

It is not moving player to position if they have gamepass?

Asked by 3 years ago
local id = 18411129
parent = script.Parent
player = game.Players.LocalPlayer
AnotherBrick = game.Workspace.winners
parent.Touched:connect(function(part) -- 3
    if part.Parent.Humanoid then -- *
        if part.Parent.Humanoid.Health > 0 then -- 4
            if game:GetService("GamePassService"):PlayerHasPass(player, id) then 
                part.Parent:MoveTo(AnotherBrick.Position) -- 5
                print("success!")
            else
                player:PromptGamePassPurchase(player, id)
            end
        end
    end
end)
0
Why are you using the Legacy version of checking if a player owns a gamepass? UserOwnsGamepassAsync it the current method, and should be used instead of PlayerHasPass. https://developer.roblox.com/en-us/api-reference/function/MarketplaceService/UserOwnsGamePassAsync appxritixn 2235 — 3y
0
That means you should use MarketplaceService instead of GamePassService appxritixn 2235 — 3y

Answer this question