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

How to do auto save for tools such as saving a player's sword?

Asked by
thePyxi 179
7 years ago

I never thought of this before but autosaving tools seems like an interesting thing. I can't find a link anywhere for Autosave Tool, but it would be awesome if someone were to teach me this concept.

1 answer

Log in to vote
0
Answered by 7 years ago

First
You will want to create a script in the workspace. This script will create an IntValue In the player that will state if they own a sword

local parent = script.Parent
local player = game.Players.LocalPlayer
local sword = Instance.new('IntValue', player)

game.Players.PlayerAdded:connect(function()
    sword.Name = "SwordOwned"
end)

Second
You will want the game to save Here is the roblox wiki article http://wiki.roblox.com/index.php?title=Saving_Player_Data Lastly In the article, where it talks about loading the data put that in the First Script under sword.Name

Hope This Helped

0
You can't use LocalPlayer in regular scripts, only on studio. Local Scripts don't work in workspace. There's almost never a reason to use a PlayerAdded event in a Local Script. User#11440 120 — 7y
Ad

Answer this question