I’m making a gamepass tool giver, but the problem is that the tool is not getting parented to the player’s Backpack, the “aa” was printed but the tool didn’t get parented, I even tried resetting but it still didn’t do anything but print “aa”.
local serverStorage = game:GetService("ServerStorage")
local tool = {
{7681339, "Gun"}
}
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
for i = 1, #tool do
local gamepassId = tool[i][1]
local toolname = tool[i][2]
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, gamepassId) then
print("aa")
serverStorage:WaitForChild(toolname):Clone().Parent = player.Backpack
else
print("a")
end
end
end)
end)
I believe this is a typo on spelling. Server Storage should be capitalized.
serverStorage:WaitForChild(toolname):Clone().Parent = player.Backpack
Should be:
ServerStorage:WaitForChild(toolname):Clone().Parent = player.Backpack