• 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!

Distanceeffect can hurt :P

wesoly136

Member
Joined
Jul 30, 2009
Messages
562
Reaction score
9
Hi! I don't know how to do a distance effect to make damage...
I want to do something like a trap then when you stepIn on a tile an arrow will be shoot from x to y postition and will damage the player who steppedIn the tile :D
Like this:

Thanks
 
Code:
if(isPlayer(cid)) then
	doSendDistanceShoot({x = from x, y = from y, z = from z}, getCreaturePosition(cid), CONST_ANI_ARROW)
	doCreatureAddHealth(cid, -100)
end
 
No ale to rani tylko tego co wdepnal, a niedaloby rady zeby dostali wszyscy ktorych strzala trafi ?

English:
But this hurts only player who stepped the tile, is it possible to do it hurt all players who arrow has hit?
 
There's (in TFS) no function that returns some path as a table, so actually you can make something like statue shoots to all creatures in certain range, or if you want this arrow this way, so it flies only >>> and hurts all on this horizontal ilne, just reply here.
 
Code:
for x = 100, 105 do
	local v = getTopCreature({x=x, y=100, z=7}).uid
	if v > 0 then
		doTargetCombatHealth(0, v, COMBAT_PHYSICALDAMAGE, -100, -100, CONST_ME_NONE)
	end
end
:D
 
LUA:
for intx = fromPosition.x, some_x do
if(isPlayer(getThingFromPos({x=intx,y=fromPosition.y,z=fromPosition.z,stackpos=253}).uid) then
doCreatureAddHealth(getThingFromPos({x=intx,y=fromPosition.y,z=fromPosition.z,stackpos=253}).uid, -100)
end
end

Cikotitan always faster than me :x
 
Back
Top