Hi, I'm working on a gamepass for a boat, For some reason its saying that I don't own the gamepass when I do own the gamepass, I'm wondering if Im messing something up or.. if it's just a glitch or something.
Script 1:
local id = 1249006
game.Players.PlayerAdded:connect(function(player)
if game:GetService("GamePassService"):PlayerHasPass(player, id) then
local BoatPass = Instance.new("BoolValue")
BoatPass.Name = "BoatPass"
BoatPass.Parent = player
end
end)
Script 2:
local boat = game.ServerStorage.SpeedBoat
function onMouseClick(player)
if player:FindFirstChild("BoatPass") ~= nil then
boat:Clone().Parent = game.Workspace
wait(10)
else
script.Parent.Parent.SurfaceGui.TextLabel.Text = "Error, you don't own the Speedboat Gamepass."
wait(5)
script.Parent.Parent.SurfaceGui.TextLabel.Text = "Spawn a Speedboat."
end
end
script.Parent.MouseClick:Connect(onMouseClick)
It keeps saying the text and not spawning the boat, even though I own the game pass, any help?

2 comments
You can try using the new api https://wiki.roblox.com/index.php?title=API:Class/MarketplaceService/UserOwnsGamePassAsync
?