So, not a long time I go, I made a script that gives players a game pass they bought, right? Well, it’s working only for me. My friend bought it and received nothing, two players bought it and nothing.
Script:
local MarketPlaceService = game:GetService("MarketplaceService")
local GamepassId = 46741729
local Tool = script.M67
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
if MarketPlaceService:UserOwnsGamePassAsync(Player.UserId, GamepassId) then
local ToolClone = Tool:Clone()
ToolClone.Parent = Player.Backpack
end
end)
end)
I don’t have any idea why is this not working.
I tried to contact RS, but they completely ignored me.
local MarketPlaceService = game:GetService("MarketplaceService")
local GamepassId = 46741729
local Tool = script.M67
game.Players.PlayerAdded:Connect(function(Player)
print(0)
Player.CharacterAdded:Connect(function(Character)
print("-")
if MarketPlaceService:UserOwnsGamePassAsync(Player.UserId, GamepassId) then
print(1)
local ToolClone = Tool:Clone()
ToolClone.Parent = Player.Backpack
end
end)
end)
18:32:51.279 M67 is not a valid member of Script "ServerScriptService.weapontest" - Server - weapontest:4
18:32:51.279 Stack Begin - Studio
18:32:51.279 Script 'ServerScriptService.weapontest', Line 4 - Studio - weapontest:4
18:32:51.279 Stack End - Studio
18:32:51.279 ServerScriptService.Explosive+:4: Expected identifier when parsing expression, got 'local' - Studio - Explosive+:4
18:32:51.280 Character is not a valid member of ServerScriptService "ServerScriptService"
local MarketPlaceService = game:GetService("MarketPlaceService")
local GamepassId = 46741729
local Tool = script:WaitForChild("M67")
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function()
if MarketPlaceService:UserOwnsGamePassAsync(Player.UserId, GamepassId) then
local ToolClone = Tool:Clone()
ToolClone.Parent = Player.Backpack
end
end)
end)
local MarketPlaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local GamepassId = 46741729
local Tool = script:WaitForChild("M67")
Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
if not MarketPlaceService:UserOwnsGamePassAsync(Player.UserId, GamepassId) then return end
Tool:Clone().Parent = Player.Backpack
end)
end)
18:45:13.749 Stack Begin - Studio
18:45:13.749 Script 'ServerScriptService.Test2.AK47.Program_Server', Line 4 - Studio - Program_Server:4
18:45:13.749 Stack End - Studio
18:45:13.750 'MarketPlaceService' is not a valid Service name - Server - Test1:1
18:45:13.750 Stack Begin - Studio
18:45:13.750 Script 'ServerScriptService.Test1', Line 1 - Studio - Test1:1
18:45:13.750 Stack End - Studio
EDIT:
What you can do is just change the gamepassid in the script to something else to check if you still get the weapon, if you do not it is working like its supposed to
I didn’t miss that, I’m just saying that you should be able to fix the error: MarketPlaceService is not a valid Service name. There’s just a typo in the service name. I don’t know why the script isn’t working otherwise.