I need help with this. how do i convert a string to a number?
here is how i get the String
local value = script.Parent.Parent.TextBox.Text
This is a another script ^^^^
And here is the script
wait(3) local event = game.ReplicatedStorage.Events.UpgradeEvent print("A") event.OnServerEvent:Connect(function(player,stat,valuea) print("A") print(player, stat) local stats = player.Stats 14 if stats.UpgradePoints.Value >= valuea then stats.stat.Value = stats.stat.Value + valuea stats.stat.Value = stats.stat.Value - valuea end end)
Tonumber is the answer to your question
local value = tonumber(script.Parent.Parent.TextBox.Text)
Tonumber will return nil if it finds a non-numeric character in the string