Quote:
Originally Posted by thefear511
HTML Code:
function panthera()
add_npc(gv("x"),gv("y"),710)
end
if that one didn't work use this. must add panthera() to the last column of the item in itemresource.
|
I don't recommend doing it via script, but if you really want to do it, I'd beg you... don't write it that way. the name of the function is a joke... i know it's not yours but once you decided to correct this guy you might as well have written it properly.
to create a new summoning scroll just take some other summon scroll as a base and replace the monster's ID.
if you want to do it with a function? I recommend doing it this way:
HTML Code:
function Summoning_Scroll( monster_id )
add_npc( gv("x"), gv("y"), monster_id )
end
Why?
The function name should always speak for itself what it does.
why did I enter "Monster_ID" as an argument to the function?
because the functions we write should be as flexible and universal as possible.
hence let's assume that our colleague wants to add another scroll, then he doesn't have to create another separate function that does exactly the same thing.
but it just changes the argument to itemresource.
how to use ?
in the table script in ItemResource just enter
Summoning_Scroll(710)
if you want it to be a different monster just replace the number. nothing easier.
Quote:
Originally Posted by khshe
function panthera() -- add for script in item
local current_x = gv("x")
local current_y = gv("y")
add_npc(current_x,current_y,710,1) -- 710 id mob
end
скрипт луа , это ну прям совсем простой вариант. еще можно через скилресурс сделать
|
And I think I'll have to teach you how to write scripts XD
now i know who wrote them in revo before i joined :D