• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Need Help with Cool quest

destroyer667

Member
Joined
Nov 21, 2007
Messages
290
Reaction score
6
I was wondering if it was possible to make these statues shoot you with an arrow if you step on the wrong tile. Only the statue in the right row would shoot you with an arrow here is a picture i honestly dont know where i'd begin with this unless i made them into a monster but then they would just shoot you all the time. Also so people cant block the arrows for other people maybe it would be possible if they could focus on only the player who stepped on the wrong tile? if not then thats ok to :]

msyywz.jpg
 
well i think i figured out if you step on the tile the tile shoots you hahaha but how can i get it so that i step on the tile and the statue shoots you?
status id
PHP:
3742

EDIT: Btw using Avesta 7.6

LUA:
<movevent event="StepIn" itemid="426" script="StatueShoot.lua" />
LUA:
function onStepIn(cid, item, pos)
	doSendAnimatedText(pos,350,144)
	doCreatureAddHealth(cid,-350)
	doSendDistanceShoot(cid,CONST_ANI_ARROW)
end


like i said with this script i honestly dont know where to begin at all. idk what other scripts i could look at so i can take bits and pieces because thats how i script.
 
Well i could make every spot a PZ zone and the wrong tiles not pz and u would get shot if i made them into a monster but then all 3 statues would shoot you :D

EDIT: errr then again 3 people could just block the statues.. i guess if the dmg is lower
 
what about this. going to test is and see what happens. But i think with this all the 426 the statue will keep shooting you.
LUA:
function onStepIn(cid, item, pos)
    if item.itemid == 3742 and item.itemid == 426 and item.uid == 40001 then
	 if isPlayer(cid) then
	doCreatureAddHealth(cid,-350)
	doSendDistanceShoot(cid,CONST_ANI_ARROW)
            end
        return 1
end
end



I tested it. Doesn't work step on tile nothing happens / Get no error. So im completely lost with this one. +rep if anyone can help :D
 
Last edited:
because it's too specific, you need some basic knowledge about general lua, positions and TFS functions here

tip: doSendDistanceShoot(fromPos, toPos, type)

fromPos should be position of statue, toPos position of player and type the distance effect
 
positions and TFS functions here

isn't a link if you intended it on being one.


i tried what you said but i get this error ')' expected near '=' this is what i have so far.



Edited: Tried to make the tile go down when you step on but didn't work. Script doesn't work at all. im still failing at this.

LUA:
function onStepIn(cid, item, frompos, topos)
    if item.itemid == 426 and item.uid == 40001 then
	 if isPlayer(cid) == 1 then
	doCreatureAddHealth(cid,-350)
	doTransformItem(item.uid,item.itemid-1)
	doSendDistanceShoot({x=32850, y=32276, z=9, x=32848, y=32276, z=9, CONST_ANI_ARROW})
        doTransformItem(item.uid,item.itemid+1)   
         end

        return 1
end
end
 
Last edited:
isn't a link if you intended it on being one.


i tried what you said but i get this error ')' expected near '=' this is what i have so far.



Edited: Tried to make the tile go down when you step on but didn't work. Script doesn't work at all. im still failing at this.

LUA:
function onStepIn(cid, item, frompos, topos)
    if item.itemid == 426 and item.uid == 40001 then
	 if isPlayer(cid) == 1 then
	doCreatureAddHealth(cid,-350)
	doTransformItem(item.uid,item.itemid-1)
	doSendDistanceShoot({x=32850, y=32276, z=9}, {x=32848, y=32276, z=9}, CONST_ANI_ARROW)
        doTransformItem(item.uid,item.itemid+1)   
         end

        return 1
end
end

It was missing a few brackets. Don't know if it will work tho
 
Nope still doesn't work this is what it looks like now.

LUA:
	<movevent event="StepIn" uniqueid="40001" script="poi/statueshoot.lua" /> --- Tile on map editor uniqueid is 40001

LUA:
function onStepIn(cid, item, frompos, topos)
    if item.itemid == 426 and item.uid == 40001 then
	 if isPlayer(cid) == 1 then
	doCreatureAddHealth(cid,-350)
	doTransformItem(item.uid,item.itemid-1)
	doSendDistanceShoot({x=32850, y=32276, z=9}, {x=32848, y=32276, z=9}, CONST_ANI_ARROW)
        doTransformItem(item.uid,item.itemid+1)   
         end
 
        return 1
end
end
 
see. i've been looking at lua tutorials and i get them but none of them really explain anything other then how to make a script like "step on tile and change your group" this script im trying to do is completely new to me and i have 0 idea on how to make it. i mean i've tried and tried you can see my posts. Can anyone who knows scripting well fix my script so it works ? im trying my butt off but im getting frustrated haha :P
 
is this what you mean? i added it to my script it didn't work. i didn't know where to add it in the script or how. I do not understand this script at all. I can understand alot of other scripts etc such a anni and everything but this one is just completely different then anything i've ever seen so i mean if you give me lines to help me out im gonna just toss them in there and pray the script starts working... im completely 110% lost with this script.

LUA:
function onStepIn(cid, item, frompos, topos)
    if item.itemid == 426 and item.uid == 40001 then
	 if isPlayer(cid) == 1 then
	doCreatureAddHealth(cid,-350)
	doTransformItem(item.uid,item.itemid-1)
	doSendDistanceShoot({x=32850, y=32276, z=9}, {x=32848, y=32276, z=9}, CONST_ANI_ARROW)
        doTransformItem(item.uid,item.itemid+1)   
        doSendDistantShoot(statue1Pos, getCreaturePosition(cid), CONST_ANI_ARROW)
	doSendDistantShoot(statue2Pos, getCreaturePosition(cid), CONST_ANI_ARROW)
	doSendDistantShoot(statue3Pos, getCreaturePosition(cid), CONST_ANI_ARROW)
	 end
 
        return 1
end
end


I gave +rep to the people helping me though i very much appreciate the attempts
 
Back
Top