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

Roblox Script Not Getting The Actual Stored Value From a Variable?

Asked by 5 years ago
Edited 5 years ago

I am simply at a loss for words here. For whatever reason, scripts are not reading the actual stored value inside this variable. I was attempting to make a datastore and it stopped working because the script was not getting the proper amount of money in leaderstats. But that is not important at the moment. What is important is figuring out why. When I run this very very simple script, it prints out the variable as it should. However, when I go to change the variable to true, the resulting output is still false. This goes the same for any variable type. I am simply baffled that something so seemingly simple is giving me such a headache. I would appreciate any help here.

while true do
    print(workspace.Value.Value)
    wait(1)
end

I also made a youtube video depicting the issue: https://youtu.be/t2N9k6b0F7k

0
Regarding your comment, can you send me a copy of the problematic place / script? Since this works when I try myself... SerpentineKing 3885 — 5y
0
https://www.roblox.com/games/237784442/Personel-Server-No-9. Sorry for the late reply and thank you again for the help! Djmaster444 5 — 5y

1 answer

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

Most likely the issue is that you are changing the variable on the Client (with a LocalScript) when you should be changing the value on the Server.

Your video doesn't show which mode of PlaySolo your are in, though based on what the angle of the player is, I'm going to assume you were on the Client-Side. If you wanted the value to print, you'd need to place the code you have above into a LocalScript.

This is because with FilteringEnabled set to true, changes are not replicated from the Client to the Server

Since you want a DataStore, you will need to use Remote Events to ask to server to make changes to your game's saved values.

0
Thank you for your answer. But the thing is, I already had the system made, everything was working variable-wise and then it suddenly stopped working. I also used a server script in that video. Djmaster444 5 — 5y
Ad

Answer this question