The Powder Toy
Download
Forum
Browse
Wiki
FAQ
Play online
Register
Login
Discussions
/
Help
/
lua makes me ashamed
«
1
2
3
4
»
lua makes me ashamed
edza101
17th Jun 2011
Member
0
Permalink
Or use old code with ! Before it!
GreekGuy
17th Jun 2011
Member
0
Permalink
I KNOW!!!! but thanks anyway
edza101
17th Jun 2011
Member
0
Permalink
Soz but I would use the old code anyways it's more user-friendly ect ect.
GreekGuy
17th Jun 2011
Member
0
Permalink
yeah.
ief015
17th Jun 2011
Former Staff
0
Permalink
Type this in your console:
tpt.register_step(function() tpt.create(25, 25, "merc") end)
tpt.register_step(
function
func) looks for a
function
as an argument. So, you give it a function. In the function we give tpt.register_step, we use tpt.create.
Edited by
ief015
, 2011-06-16 22:44:22
GreekGuy
17th Jun 2011
Member
0
Permalink
thanks
i was sorta close:
tpt.register_step=(tpt.create (25, 25) MERC)
Edited by
GreekGuy
, 2011-06-17 14:18:05
ief015
17th Jun 2011
Former Staff
0
Permalink
@GreekGuy
(View Post)
Look at the sample code in the wiki to get a grasp of what Lua looks like.
https://powdertoy.co.uk/Wiki.html?id=lua#simple_example_code
Edited by
ief015
, 2011-06-17 16:10:08
boxmein
17th Jun 2011
Former Staff
0
Permalink
tpt.register_step()
tpt.create(25,25,*Element ID here, NOT THE NAME*)
that's it. Just a newline was missing.
GreekGuy
17th Jun 2011
Member
0
Permalink
thanks everyone
gunz
17th Jun 2011
Member
0
Permalink
@MasterMind555
how do i save it as lua
«
1
2
3
4
»