So I had a gamepass Script that was working perfectly fine before, everything was right and worked for as long as I can remember, well now it doesn’t. I went to (in studio),
Test
Start (Local Server, 1 Player)
Then the following happens,
It didn’t do this before and here’s the script,
local id = 6170599
local mp = game:GetService("MarketplaceService")
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
mp.PromptGamePassPurchaseFinished:Connect(function(plr,ido,purchased)
if purchased and id == ido then
local trail = game.ServerStorage.RainbowTrail:Clone()
trail.Parent = char.HumanoidRootPart
trail.Name = "CurrentTrail"
local attachment0 = Instance.new("Attachment",char.Head)
attachment0.Name = "TrailNum0"
local attachment1 = Instance.new("Attachment",char.HumanoidRootPart)
attachment1.Name = "TrailNum1"
trail.Attachment0 = attachment0
trail.Attachment1 = attachment1
end
end)
end)
end)
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
if mp:UserOwnsGamePassAsync(player.UserId,id) then
local trail = game.ServerStorage.RainbowTrail:Clone()
trail.Name = "CurrentTrail"
trail.Parent = char.HumanoidRootPart
local attachment0 = Instance.new("Attachment",char.Head)
attachment0.Name = "TrailNum0"
local attachment1 = Instance.new("Attachment",char.HumanoidRootPart)
attachment1.Name = "TrailNum1"
trail.Attachment0 = attachment0
trail.Attachment1 = attachment1
end
end)
end)
Any Help is appreciated, thanks in advanced,
-Notrealac0unt
I’m curious (i know its a bit off topic) but do you need to connect PromptGamePassPurchaseFinished every time the character is added? If not doesn’t this mean when the player buys the gamepass that they would receive the trail a lot of times depending on how many times characters have been added.
local mp = game:GetService("MarketplaceService")
id = 6170599
script.Parent.MouseButton1Click:Connect(function()
mp:PromptGamePassPurchase(game.Players.LocalPlayer,id)
end)
Also I got to go I’ll check in as soon as I get back
I know others are seeing this issue in there games as well and @Preloader is trying to go about it through the Post approval process as stated by @REALTimothy0812 but is this an actual bug or is there actually something wrong with the script?