Diogo FIh Posted March 6, 2022 Posted March 6, 2022 (edited) Existe alguma funcao para forcar um calculo neste estilo ? local teste = "123+44/22-33" iprint(tonumber(teste)) Edited March 6, 2022 by Diogo FIh
Moderators Tut Posted March 6, 2022 Moderators Posted March 6, 2022 Moving this into the Portuguese scripting section. 1 Give a man a fish and you feed him for a day. Teach him how to fish and you feed him for a lifetime - Lao Tzu
Diogo FIh Posted March 6, 2022 Author Posted March 6, 2022 22 minutes ago, Tut said: Moving this into the Portuguese scripting section. como faço isso?
KronoS Lettify Posted March 7, 2022 Posted March 7, 2022 On 06/03/2022 at 11:54, Diogo FIh said: Existe alguma funcao para forcar um calculo neste estilo ? local teste = "123+44/22-33" iprint(tonumber(teste)) Você pode utilizar o loadstring de Lua para isso. Veja o seguinte exemplo: local teste = "123+44/22-33" local final = loadstring('return '..teste)() print(final) --output: 92 Página Facebook: The News Joker (The Piadas & News) Discord: @kronos.lettify em Discord oficial do MTA Dê um THANKS se minha ajuda ou comentário foi útil para você.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now