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

How would i go converting any values found in a folder to strings and saving when a player leaves?

I'm on a phone right now but i was wondering, is there a way to check when a player leaves if any new values were aded, then convert them to strings that are saved via datastore?

Onplayerleave:connect(Player)
If player.folder then
player.folder.Value:tostrin&
Getasync
End

((Sorry its so bland but i dont understand it well...))

Help would be appreciated..

3 comments

1

First, if and end are NOT capitolized.

0

As i said. Wrote it on a phone.

0

Yes in reply to your question.

1 answer

✓ Accepted answer

#What you could do You could do tostring. But the problem with that is how would you be able to undo it? You could save a dictionary and state the value types inside of the table.


#tostring Tostring takes ANY value type and turns it into string form.

--What is this useful for?
print("The value is: "..val) 
--If the value isn't a string value then it'll be unable to be concatenated and will error. If we tostring it it'll be a double check to make sure the script doesn't error and break your game.

print("The value is: "..tostring(val))

Hope it helps!

1 comment

0

So if i just give it a dictionary to take the values from, itll just take everything in there and turn it to a string?

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