So I have a few scripts that give certain items when you buy certain levels of VIP, and that has worked fine. What I just noticed today is that after I die, I don't keep any of the items, and they only stay in my inventory for the life I join the game in.
The tool is placed into Startergear, so I don't know the problem.
This is the script
local passId = 254941359 local potato = game.Lighting:WaitForChild("VIP") function isAuthenticated(player) return game:GetService("MarketplaceService"):PlayerOwnsAsset(player, passId) end game.Players.PlayerAdded:connect(function(plr) -- player is already defined if isAuthenticated(plr) then print(plr.Name .. " has bought the game pass with id " .. passId) potato:Clone().Parent = plr.Backpack potato:Clone().Parent = plr.StarterGear end end)
Please respond, this is kind of urgent.
PlayerAdded is only fired when a player joins the server. Use character added instead so that everytime the player respawns their character is readded to the game and therefore this script will give them their gear back
local passId = 254941359 local potato = game.Lighting:WaitForChild("VIP") function isAuthenticated(player) return game:GetService("MarketplaceService"):PlayerOwnsAsset(player, passId) end game.Players.PlayerAdded:connect(function(plr) -- player is already defined plr.CharacterAdded:connect(function(Character) --will check when character is readded(cause of death usually) and readd those tools. You can now use Character to reference the character and plr to reference the player if isAuthenticated(plr) then print(plr.Name .. " has bought the game pass with id " .. passId) potato:Clone().Parent = plr.Backpack potato:Clone().Parent = plr.StarterGear end end)