--My code is:
local id = 6485848 local barret = game.ServerStorage:FindFirstChildOfClass("Tool")
game.Players.PlayerAdded:Connect(function(player) if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.userId,id) then local barretClone = barret:Clone() barretClone.Parent = player:WaitForChild("Backpack") end end)
--This script only adds the tool only when the player enters the game, not when they spawn. I tried using CharacterAdded but that is not a child of players, any suggestions?
try this script, place it in the ServerScriptStorage
local gpid = 6331302 -- Gamepass ID tools = {"HasSpeedPassBool"} --Tool Name, place the item in a tool in the ServerStorage GPS = game:GetService("GamePassService") GPS2 = game:GetService("MarketplaceService") game:GetService("Players").PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(char) if char:FindFirstChild("Humanoid") ~= nil then print("Has humanoid") if GPS2:UserOwnsGamePassAsync(player.UserId,gpid) then -- this is for the new gamepass gpid, not the old assetid for _,v in pairs(tools) do if game:GetService("ServerStorage"):FindFirstChild(v) then game:GetService("ServerStorage"):FindFirstChild(v):clone().Parent = player.Backpack end end else print("Not awarding item") end end end) end)