Hi
So I’ve making a lifting simulator game with 3 other people. I want to let them have a gamepass ability for free. Here is the script I made, I tried detecting userId and name but it doesn’t give them the ability. The detecting purchase part works perfectly, it just won’t detect them. Could someone please help?
local id = 689674434
local PandaId = 2310498136
local BranId = 3829571684
local kirbyId = 2343449849
wait(1)
-- Testers Free Gamepass
game.Players.PlayerAdded:Connect(function(plr)
local Pass = plr:FindFirstChild("PassStrengthMultiplyer")
if plr.UserId == PandaId then
Pass.Value = 2
else
Pass.Value = 1
end
end)
game.Players.PlayerAdded:Connect(function(plr)
local Pass = plr:FindFirstChild("PassStrengthMultiplyer")
if plr.UserId == kirbyId then
Pass.Value = 2
else
Pass.Value = 1
end
end)
game.Players.PlayerAdded:Connect(function(plr)
local Pass = plr:FindFirstChild("PassStrengthMultiplyer")
if plr.UserId == BranId then
Pass.Value = 2
else
Pass.Value = 1
end
end)
-- Detecting
game:GetService("MarketplaceService").PromptGamePassPurchaseFinished:Connect(function(plr,ido,purchased)
if purchased and ido == id then
plr.PassStrengthMultiplyer.Value = 2
else
plr.PassStrengthMultiplyer.Value = 1
end
end)
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:connect(function(char)
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(game.Players[char.Name].UserId, id) then
plr.PassStrengthMultiplyer.Value = 2
else
plr.PassStrengthMultiplyer.Value = 1
end
end)
end)
Thank you