this code is supposed to add clothes to a player when the player doesn’t have a gamepass the problems with this are, it’s not showing me any error’s so I don’t know what’s wrong and it doesn’t give the player the clothes when it’s supposed to.
I’ve looked at the “PlayerAdded” and “characterAdded” on the Roblox dev page and looked at some videos on youtube and I Can’t seem to get it working (it’s set to true so i could see if it would give me the clothes and it doesn’t)
local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local gamepass = 13301294
game.Players.PlayerAdded:Connect(function(AdddedPlayer)
AdddedPlayer.CharacterAdded:Connect(function(Character)
local succcess, message = pcall(function()
hasPass = MarketplaceService:UserOwnsGamePassAsync(Players.UserId, gamepass)
end)
if hasPass == true then
print("alreadyhave")
if Character:FindFirstChild("Shirt") then
Character.Shirt = "rbxassetid://594022753"
else
Instance.new("Shirt",Character)
Character.Shirt = "rbxassetid://594022753"
end
if Character:FindFirstChild("Pants") then
Character.Pants = "rbxassetid://129459076"
else
Instance.new("Pants",Character)
Character.Pants = "rbxassetid://129459076"
end
end
end)
end)