local productId = 37348329
local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
game:GetService("MarketplaceService"):PromptPurchase(player, productId)
end)
local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
game:GetService("MarketplaceService"):PromptPurchase(player, 37348329)
end)
I have this script in a normal script in the Workspace which makes the game pass work. I’m not sure if there are any errors tho, gives me nothing in the output
local gamepassId = 37348329
local service = game:GetService("MarketplaceService")
game.Players.PlayerAdded:Connect(function(player)
if (service:UserOwnsGamePassAsync(player.UserId, gamepassId)) then
local tags = {
{
TagText = "chad",
TagColor = Color3.fromRGB(74, 75, 69)
}
}
local ChatService = require(game:GetService("ServerScriptService"):WaitForChild("ChatServiceRunner").ChatService)
local speaker = nil
while speaker == nil do
speaker = ChatService:GetSpeaker(player.Name)
if speaker ~= nil then break end
wait(0.01)
end
speaker:SetExtraData("Tags",tags)
speaker:SetExtraData("ChatColor",Color3.fromRGB(0, 170, 255))
end
end)
Maybe you should use PromptGamePassPurchase instead
local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
game:GetService("MarketplaceService"):PromptGamePassPurchase(player, 37348329)
end)
Maybe, but check your gamepasses settings again. You probably missed something important. Or play the game instead of play testing in studio and see if it works
I’ve been receiving those errors in game, but after checking the script in studio it gives me some highlighted stuff and an error in the output, any clue on what could be causing this?
There is nothing that defines what service and gamepassId are, hence the orange text. As for the red text, simply replace the if statement line with this:
if (service:UserOwnsGamePassAsync(player.UserId, gamepassId)) then
Edit: I see. I didn’t see your reply when I was typing this