Hi. I am trying to get an integer from an rbxassetid://, but I need to figure out how do it. I tried this, but it doesn't work. I have no idea, would anybody help me out?
tonumber(string.sub(game.Workspace.Music.SoundId,string.len(game.Workspace.Music.SoundId)-(13)))
The script is supposed to get the last characters of a string (Counting the characters in the string and minus it by 13, the letters in rbxassetid.) and then using tonumber to make it an integer. But tonumber returns nil, which means the string contains also other characters rather than numbers... Any help?
local ID = game.Workspace.Music.SoundId ID = ID:sub(string.find(ID,"%d+")) print(ID)