Hello again! I’ve created a GUI shop with gears that player can buy with money (not R$). But if a player who bought the gear dies, he will lose it. I don’t want to make player work for money again and again. The script after buy button is pressed is
game.ReplicatedStorage.ToolEvents.DroneEvent.OnServerEvent:Connect(function(player) if player.leaderstats.Money.Value >= 500 then player.leaderstats.Money.Value = player.leaderstats.Money.Value - 500 game.ServerStorage.Tools.SpyDrone:Clone().Parent = player.Backpack end end)
I was creating tool events to make their function stay. As you see after the tool is bought its cloned to player's backpack. I'm a big rookie in scripting, so I hope you will help. Also, thanks!
You would want to also clone another spydrone
to the player's StarterGear
which would give the player the spydrone
after death
Now, this does not solve your question IF you want it to save when the player leaves the game
game.ReplicatedStorage.ToolEvents.DroneEvent.OnServerEvent:Connect(function(player) if player.leaderstats.Money.Value >= 500 then player.leaderstats.Money.Value = player.leaderstats.Money.Value - 500 game.ServerStorage.Tools.SpyDrone:Clone().Parent = player.Backpack game.ServerStorage.Tools.SpyDrone:Clone().Parent = player.StarterGear end end)
Create a Boolvalue
named after every gear and parent it to a Folder
in every Player
that joins and when the gear is bought the BoolValue
is set to true and if the Player
dies then the server will check if the BoolValue
is true. (Keep in mind scriptinghelpers.org is NOT a request site, that is one of the reasons I didn't provide code)