local mps = game:GetService("MarketplaceService") local gamepass_id = 8946545 game.Players.PlayerAdded:Connect(function(player) if mps:UserOwnsGamePassAsync(player.UserId, gamepass_id) then game.ServerStorage("Lemonaide Bleach"):Clone().Parent = player:WaitForChild("Backpack") game.ServerStorage("Lemonaide Bleach"):Clone().Parent = player:WaitForChild("StarterGear") end end) game.ReplicatedStorage.Give.OnServerEvent:Connect(function(player) game.ServerStorage("Lemonaide Bleach"):Clone().Parent = player:WaitForChild("Backpack") game.ServerStorage("Lemonaide Bleach"):Clone().Parent = player:WaitForChild("StarterGear") end)
I want to make it so that if the gamepass is bought, Lemonaide Bleach will be inside of the players inventory forever. Please help!
One thing I noticed about your script: You add the item to starter pack. This is not a good idea, as if it decides to actually put it in the starter pack, it will give it to all players on respawn. Instead, you just need make a connect on player reset function that checks if the player that that was just added has the gamepass, then gives the item to them. Heres the fixed script:
wait(2) --Keep at 2 for safety. local gpid = 3333333333 --Change to your gamepass id local mps = game:GetService("GamePassService") -- You need the gamepass service, not the marketplace service. function respawned(char) player = game.Players:FindFirstChild(char.Name) print("Respawned") if char:FindFirstChild("Head") ~= nil then print("It's a Player!") if GPS:PlayerHasPass(player, gpid) then print("Has gamepass") game.ServerStorage("Lemonaide Bleach"):Clone().Parent = player.Backpack else print("No gamepass") end end end game.Workspace.ChildAdded:connect(respawned)
local mps = game:GetService("MarketplaceService") local gamepass_id = 8946545 game.Players.PlayerAdded:Connect(function(player) if mps:UserOwnsGamePassAsync(player.UserId, gamepass_id) then game.ServerStorage("Lemonaide Bleach"):Clone().Parent = player:WaitForChild("Backpack") plr.CharacterAdded:Connect(function(Character) repeat wait() until plr.Character ~= nil local player = game.Players:GetPlayerFromCharacter(Character) game.ServerStorage("Lemonaide Bleach"):Clone().Parent = player:WaitForChild("Backpack") end) end)
Don't put the gear in the StarterPack, instead put it in the backpack when respawning.