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

how do I get tools to save after you leave or die?

Asked by 5 years ago

I'm making a simulator game and I want to make it so you don't have to buy an item again after you die or leave. I've looking all the over the internet and I can't seem to find anything that works

0
datastore Shubu13 29 — 5y

1 answer

Log in to vote
0
Answered by
Shubu13 29
5 years ago
Edited 5 years ago

(I may be wrong I'm new to scripting) You would need a value to assign a person a tool and after you have that value you can just datastore, for example:

01--//DataStore (I'm too lazy to do it but here take this :p)
02game.Players.PlayerAddded:Connect(function(plr)
03    local stats = Instance.new("Folder", plr)
04    stats.Name = "Stats"
05 
06    local knife = Instance.new("StringValue", stats)
07    knife.Name = "Knife"
08    knife.Value = "N/A"
09    --//DataStorage Goes Here
10end
11--//Check Tool
12game.Players.PlayerAdded:Connect(function(plr)
13    if player.Stats.Tool.Value == "BoxKnife" then
14        local boxknife = game.ServerStorage.Tools.BoxKnife
15        boxknife.Parent = game.StarterPack
View all 22 lines...

Something Like This (I thought of that in half a minute)

Ad

Answer this question