Hermes
dziwki kola gramy w lola
Hi there!
I think my scripting abilities have been increased since I registered here. But there are few things that I don't understand, so I made this thread to ask you few questions.
1. Are
the same like
?
And how about
?
2. How to make that if something is something then script is terminated? For example:
3. How to make a "stop" in a script for "interval" time? For example:
4. Is there a way to remove summonned creatures from certain area? If it's possible then how to set names of creatures, that will be deleted from the area when script is being executed?
This code is for checking is ANY creature is in certain area, it may help.
5. How to execute database queries from LUA scripts? For example how to change "worldid" of character determined in param?
Thanks in advance for all the answers,
Hermes
I think my scripting abilities have been increased since I registered here. But there are few things that I don't understand, so I made this thread to ask you few questions.
1. Are
Code:
return TRUE and return FALSE
Code:
return true and return false
And how about
Code:
return 1 and return 0
2. How to make that if something is something then script is terminated? For example:
Code:
local number = 10
local second_number = 20
if(number == 10 and second_number == 20) then
something
elseif(number ~= 10 or second_number ~= 20) then
[B]exit script (and ofcourse rest of the script won't be executed[/B]
...
3. How to make a "stop" in a script for "interval" time? For example:
Code:
local number = 10
local second_number = 20
local interval = 2000 (in ms)
if number == 10 then
[B]script waits "interval" time, and then rest of it is executed[/B]
second_number = 20 + number
...
4. Is there a way to remove summonned creatures from certain area? If it's possible then how to set names of creatures, that will be deleted from the area when script is being executed?
Code:
for arenax = 1000, 1020 do
for arenay = 950, 1000 do
arenapos = {x=arenax, y=arenay, z=7, stackpos=253}
arenacreature = getThingfromPos(arenapos)
if arenacreature.itemid > 0 then
doPlayerSendCancel(cid,"Someone is in the area.")
return 1
end
end
end
5. How to execute database queries from LUA scripts? For example how to change "worldid" of character determined in param?
Thanks in advance for all the answers,
Hermes