I'm a fairly new scripter and make errors very often could you please check the following script for errors, it is a script for a game pass connected button
local gamePassId = 7691347
function vip(player) game:GetService("GamePassService") bool PlayerHasPass ( Player player, int gamePassId ) print(player.Name .. " has the game pass!") script.Parent.Parent.Parent.VIP.Value = "true" print(player.Name .. " doesn't have the game pass...") end end
vipbutton = script.Parent.Head vipbutton.Touched:connect(vip)
Thanks!
Try this:
local passID = 0; -- put the gamepass ID here. function vip() if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(game:GetService("Players").LocalPlayer.UserId, passID) then print("I bought the pass!"); -- Change this obviously. else print("I have not bought the pass."); -- Change this obviously. x2 end; end; script.Parent.Head.vipbutton.Touched:Connect(vip);