Page 1 of 1
Message Evaluation (Execute Lua code in SMBX Messages!)
Posted: Sat Apr 18, 2020 8:05 am
by KateBulka
Salut folks, i've decided to upload a simple library, which lets you execute lua code in smbx messages!
Example:
Code: Select all
--#lua_execute#--
if player.speedX == 0 then player.speedX = -9 end
(you need to write `--#lua_execute#--` in the message so it could be executed)
Gif (Example in action):
Download -
https://drive.google.com/file/d/1BUc4tw ... sp=sharing
Don't forget to credit me, overall you are allowed to use it and modify it. Also be sure to report bugs if there are ones!
Re: Message Evaluation (Execute Lua code in SMBX Messages!)
Posted: Sat Apr 18, 2020 8:23 am
by Emral
Why would someone want to use this over a regular lua script?
Re: Message Evaluation (Execute Lua code in SMBX Messages!)
Posted: Sat Apr 18, 2020 9:18 am
by Archived
Archived
Re: Message Evaluation (Execute Lua code in SMBX Messages!)
Posted: Sat Apr 18, 2020 9:29 am
by Novarender
Enjl wrote: ↑Sat Apr 18, 2020 8:23 am
Why would someone want to use this over a regular lua script?
I think it was just done for fun/screwing around.
Re: Message Evaluation (Execute Lua code in SMBX Messages!)
Posted: Sat Apr 18, 2020 10:12 am
by Emral
Eclipsed wrote: ↑Sat Apr 18, 2020 9:18 am
Enjl wrote: ↑Sat Apr 18, 2020 8:23 am
Why would someone want to use this over a regular lua script?
They might be too lazy to create an event attached to the message, and create a lua file to answer your question. There’s really no long term benefits however to this method in the thread since it’s really hard to see your text in an smbx message.
Perhaps... I'm mostly concerned about how hard to find it will be in case something breaks, or how terrible the formatting in the message box window is. You don't even need an event either, just fill in a dummy message:
Code: Select all
function onMessageBox(eventObj, message)
if message == "dummyMessage" then
eventObj.cancelled = true
player.speedX = -9
end
end
And making a lua file is as simple as clicking a button in the editor, so it's arguably faster and easier to do it properly.
Re: Message Evaluation (Execute Lua code in SMBX Messages!)
Posted: Sat Apr 18, 2020 7:35 pm
by Yoshi021
I like this. This is cool!
Re: Message Evaluation (Execute Lua code in SMBX Messages!)
Posted: Sat Apr 18, 2020 10:22 pm
by MegaDood
Well done Core, I think you did a really good job with it. Makes accessing lua stuff a lot easier with messages.