Forum
Scripts
Adding lua in-game
Adding lua in-game
11 replies
1

sys -> lua -> server.lua
It's a textfile which should look like this:
Write
1
dofile("sys/lua/NAME.lua")
anywhere in it:
Replace "NAME" by the name of your luascript!
Do not use "--"!
In b0.1.1.9, DC disabled the option to control Lua through RCon. If you host a listen server (through 'New game'), you can just type
1
lua dofile("sys/lua/NAME.lua")
I want one script: if you say, for example, "change_zombie" in console, server changes the map and starts zombie script. If you say "change_standard" in console, server changes the map and stops zombie script. Is this possible?
1
2
3
4
5
6
2
3
4
5
6
addhook("say","zmb")
function zmb(id,msg)
	if msg=="zombie" then
	dofile("sys/lua/NAME.lua")
	end
end
I think, it's run a Script!
But I know, it works wrong
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
addhook("rcon","modechange")
function modechange(cmd)
	if (cmd=="change_zombie") then
		parse("map WHATEVERMAPYOUNEED")
		parse("luareset")
		dofile("sys/lua/URZOMBIESCRIPT.lua")
		dofile("sys/lua/MAYBEACOUPLE.lua")
	end
end
I'm not sure whether it'll work, but still try.
In my Script everyone can change it!
yes it is, but I do not know how to install script RPG Tibia World, I as treble but will not work, does anyone know how to do or even how do you ......1
--dofile("sys/lua/scriptname.lua")
The "--" is very helpful for longer Scripts if you forgot what a function mean!
1

Offline
