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

Cannot convert a sentence to be without letters?

Asked by 4 years ago
function chat(msg)
    local word = "play"
    if string.find(msg,word) then
    local converted = tonumber(msg)
    print (converted)
    sound.SoundId = "rbxassetid://"..converted
    sound:Play()
    print (converted)

    end
    end
    player.Chatted:Connect(chat)

Getting this error.

22:06:59.563 - Workspace.Script:26: attempt to concatenate local 'converted' (a nil value) 22:06:59.564 - Stack Begin 22:06:59.564 - Script 'Workspace.Script', Line 26 22:06:59.565 - Stack End

I also want to convert a string to have no letters only numbers so i can feed the string to SoundId without errors.

0
The last sentence isnt a request i am explaining what i am trying to do. antoniorigo4 117 — 4y

Answer this question