Destringing a string?

Hi, im making a debugging tool to make it easyer to create animation based entity’s (mostly sweps) i’ve already made the console command but it returns a string… :confused: i already made tons of something like (if string.blahblah"ACT_VM_PRIMARYATTACK" then animtpnext = ACT_VM_PRIMARYATTACK).

So is there a better way by just destringing a string (something like tostring() but reversed) :confused: searched gmod wiki couldn’t find anything.

animtpnext = _G[string]

Thanks

Can someone test if tonumber works on enumerations like that?

tonumber just convert from a string to number (IE “1” to 1 “-13.37” to -13.37) If it’s given letters it will return nil (even if there is anumber in the string “1x” will still return nil).