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

Save tools player had after death?

Hello, I have this buy system where a player can buy guns for his money. But I have a problem, when he dies he no longer has the weapons, and he needs to buy new weapons. So I have tried coding a thing that checks if the player has the tool. If he does not have the tool, then it gives him a new one. But I have no way of checking if the player has the tool.

1 answer

✓ Accepted answer

Make two tools, one for the player's Backpack object and one for the player's StarterGear object.

Inside a player object, there are two objects you can use: Backpack and StarterGear.

What I would do would be something like this:

local backpackWeapon = toolWeapon:Clone()
backpackWeapon.Parent = player.Backpack
local starterGearWeapon = toolWeapon:Clone()
starterGearWeapon.Parent = player.StarterGear

If done correctly, the player should get the weapon when they buy it and also have it when they respawn after dying.

Bye!

2 comments

1

Thanks so much!

0

Happy to help! :)

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