#What is wrong with my DataSave? (tryin to save a GUI number)

1 messages · Page 1 of 1 (latest)

surreal nova
#

first time doing data save and idk what wrong with it and im getting no error msgs (I think its prob the way im saving the number from the server side but idk how to fix that)

valid moon
#

Quite hard to look at Light Mode coding but anyways, I don't know if I've found the solution but I can see some things are not done correctly

#

Script

  1. I think that when you GetAsync, you don't need the tonumber(speedamounttext.Text)
  2. speedamounttext is already a string, you cannot try to look for its Text property since it is not an Instance.
  3. Move the players.PlayerRemoving out of your OnServerEvent connection.

LocalScript

In the LocalScript, speedtext = speedamount does absolutely nothing because speedtext is just a string and not actually the property, and player is not returned to LocalScripts since it would return yourself.
Do this instead:

SpeedToServer.OnClientEvent:Connect(function(speedAmount)
    local speedText = script.Parent.Text
    speedText.Text = tostring(speedAmount)
end)