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

How to save a variable to a player?

Asked by
gitrog 326 Moderation Voter
7 years ago

I want to save the variable sentenceTime to a player, and have the variable stay with the player, even if they leave the game or respawn.

How it is being used is when they are arrested, they get their time in seconds, and each second it goes down by one, and their time saves, whether they leave the game or die. How would I do this?

1 answer

Log in to vote
0
Answered by 7 years ago
Edited 7 years ago

You would not be able to save a variable from a script, you would need to create a folder or model and store strings inside of them. Then you start a save script. I suggest you read this;

http://wiki.roblox.com/index.php?title=Saving_Player_Data

or even on this website right now;

https://scriptinghelpers.org/guides/saving-and-loading-data-with-datastores

This is not a request site and probably no one would write and entire script for you. We help you learn.

If you have any other questions comment, otherwise accept answer and upvote please

Ad

Answer this question