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

The game pass item wont give me the item in game when i buy it?

Asked by 3 years ago
Edited 3 years ago

I am make A ROBLOX game and I have mad two game passes and I have put the into the shop but and made the scripts and the items where they should be And when I test the game and "buy" the game pass it doesn't give me and error it just does give me the item in my tool bar.

Sever script:

local mps =  game:GetService("MarketplaceService")
local gamespass_id = 14001200

game.Players.PlayerAdded:Connect(function(player)
    if mps:UserOwnsGamePassAsync(player.UserId, gamespass_id)then
        game.ServerStorage.RainbowMagicCarpet.Clone().Parent = player:WaitForChild"Backpack"
        game.ServerStorage.RainbowMagicCarpet.Clone().Parent = player:WaitForChild"StarterGear"
    end
end)


game.ReplicatedStorage.Give.OnServerEvent:Connect(function(player)
    game.ServerStorage.RainbowMagicCarpet.Clone().Parent = player:WaitForChild"Backpack"
    game.ServerStorage.RainbowMagicCarpet.Clone().Parent = player:WaitForChild"StarterGear"
end)

local script:

local mps = game:GetService("MarketplaceService")
local gamepass_id = 14001200

script.Parent.MouseButton1Click:Connect(function()
    local player = game.Players.LocalPlayer
    mps:PromptGamePassPurchase(player, gamepass_id)
end)

mps.PromptGamePassPurchaseFinished:connect(function(player, id, purchased)
    if id == gamepass_id and purchased then
        game.ReplicatedStorage.give:FireServer()
    end
end)

0
Does it give an error? try putting a few prints in there and tell me what it does Ch33seBurrit0 0 — 3y

Answer this question