Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago

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.

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. TheluaBanana 946 — 4y

2 answers

Log in to vote
0
Answered by
Arkrei 389 Moderation Voter
4 years ago

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

    local toolExample = toolExamplePrefab:Clone()
    toolExample.Parent = starterGear
Ad
Log in to vote
0
Answered by 4 years ago

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

Answer this question