Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do you keep your inventory when you die if the item was picked up?

I am trying to make a VIP where you can get items to help you with the obby, but you would have to go back and get the items again if you died so how can I fix that? Thanks.

1 comment

0

assuming its a gamepass, u can check if the player owns vip and give the items to them via starterpack or something on player added to the game.

2 answers

✓ Accepted answer

StarterGear makes sure that the player gets the item each time their character is loaded

	local toolExample = toolExamplePrefab:Clone()
	toolExample.Parent = starterGear

You Dont Have To Do That, you could just make a vip room with tool in that. But if no use vip room, Use a Data Store.

game:GetService(DataStoreService):GetDataStore("VIP"):SetAsync(player,true)

so when the character reset or the rejoin do this maybe... (put tool(s) in this script)

game.Players.PlayerAdded:Connect(function(p)
p.CharacterAdded:Connect(function(c)
if game:GetServiceBlahBlahBlah("VIP"):GetAsync(game.Players:GetPlayerFromCharacter(c)) == true then -- detects if VIP, if so it should be true, then executes next thing
script.tool:Clone().Parent = c
end
end)
end)

putting tool in character makes them hold it automatically, i know this because ins tudio, if you have a tool, then equip it, i see it go into your character. Or just do

script.tool:Clone().Parent = c--instead of this, do this:---v
script.tool:Clone().Parent = p.Backpack--if it deosnt work then do this:----v
script.tool:Clone().Parent = game.Players:GetPlayerFromCharacter(c).Backpack

This discussion is preserved as it was. New answers, comments, and votes are closed.