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

String taken from textlabel not doing arithmetic?

Asked by 3 years ago
Edited 3 years ago

I have two buttons one and two. When I press one plus two it will show "1+2" in my textlabel and what I will do is take the string from the textlabel and try to do arithmetic in my serverscript but it doesn't work please help

the variable number is the textlabel.text

game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(player, name, name2, number)
    local value = tonumber(number)
    if name == "Equals" then
        print(value)
    end
end)
0
I do know of tostring() but nothing on the math aymbols. Im thinking maybe theres a chance tostring() also works on symbols not just numbers in strings AlexanderYar 788 — 3y

Answer this question