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

DataStore Problems! How to save Bool?

Asked by 5 years ago

Exactly my point, I did Test on Roblox Studio, 1 player. When I exited to check if the script save, this is what it said:

20:22:04.479 - 103: bool is not allowed in DataStore 20:22:04.479 - Stack Begin 20:22:04.479 - Script 'ServerScriptService.DataStore', Line 33 - global saveclothes 20:22:04.480 - Script 'ServerScriptService.DataStore', Line 150 20:22:04.480 - Stack End

That being said, I found myself stuck pondering what to do. I tried searching up in Roblox's book, in the internet, etc. I couldn't find answers.

I would greatly appreciate the help. Pardon me if I may have made a mistake with the format and such. (First time asking a question here. I made an account literally just to ask this!)

Thanks for taking the time to read.

0
Is it preventing your game from working? Because if you don't see anything wrong with your game but it says that error I would just continue the work if I were you. There's a 99% chance that this did not help at all and I'm very sorry for that, it's just that I'm fairly a beginner and I don't even know what "bool" is. :P Nep_Ryker 131 — 5y
0
we really can't help if you don't post code snippets. radusavin366 617 — 5y
0
Post code snippets and we can help you further; it may be how you created your bool in the first place. Rallient 40 — 5y
0
Please do not say Bool. Zafirua 1348 — 5y

2 answers

Log in to vote
1
Answered by
Sir_Melio 221 Moderation Voter
5 years ago
Edited 5 years ago

I searched on Google and found the reason for the error on the first page. You need to search better. The page here explains it (the third 103 error message). Here's the reason for the error taken from that page:

You are attempting to set a Value in an OrderedDataStore to a non-numeric value. Make sure the value being input is a numeric value so that it can be sorted in the OrderedDataStore

Apparently, you're using an OrderedDataStore. OrderedDataStores are explained in the Roblox Wiki, a page can be found here. Literally, the first sentence in the description of that instance is as follows:

OrderedDataStore is a type of DataStore where the value must be an integer (positive number).

If you want to save values other than positive integers (and not necessarily ordered), use GlobalDataStores instead. A wiki page for that instance can be found here. You can find in-depth explanations on DataStores here and how to handle player data here.

0
Thanks! naturewizard 85 — 5y
Ad
Log in to vote
0
Answered by 5 years ago

the error says it all, you cant save booleans (true or falses), i would try making it an integer instead, so true becomes 1, and false becomes 0, and you really dont need ifs when loading them in because conditions can be saved to variables:

local boolget = GetAsync(blahblahblah you got a boolean)
boolget = (boolget == 1)
0
You'd need to modify that a bit to check if there's actually anything saved, because false and nil in that condition would result in the same. Sir_Melio 221 — 5y

Answer this question