• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

if(isCreature(creature.uid))...

Status
Not open for further replies.

GarQet

Own3d!
Joined
Feb 10, 2009
Messages
1,381
Solutions
14
Reaction score
81
Siema!
Mam pewien problem ze skryptem i zwracam się do was o pomoc.

Na czym polega skrypt?
Na danym obszarze wszystkim kreaturom zabiera całe życie - zabija i na cały obszar rzuca efekt.

W czym mam problem?
Wydaje mi się, ze wszystko jest dobrze, lecz skrypt nie wykonuje tego co powinien, pluje się a propos odejmowania życia kreaturom znajdującym się w danym obszarze. Proszę o pomoc.

Skrypt:
Code:
function onStepIn(cid, item, position, fromPosition)

	for x = 1017, 1019 do
 	for y = 1024, 1026 do
	local creature = getThingFromPos({x=x, y=y, z=7, stackpos=253})
     	if(isCreature(creature.uid)) then
 	doSendMagicEffect({x=x, y=y, z=7}, CONST_ME_TELEPORT)
     	doCreatureAddHealth(creature.uid, -getCreatureHealth(getThingFromPos(creature.uid)))
	end
	end
	end

Błąd:
Code:
[Error - MoveEvents Interface]
data/movements/scripts/xxx.lua:onStepIn
Description:
attempt to index a number value
stack traceback:
        [C]: in function 'getThingFromPos'
        data/movements/scripts/xxx.lua:8: in function <data/movements/scripts/xxx.lua:1>

Z góry dziękuję, pozdrawiam.
 
przeczytaj swój skrypt 3x i wpadniesz na to czemu jest źle, jak nie to jeszcze 10x
 
Wow! Faktycznie <lol2>
Ale noobski błąd ;s.
 
Status
Not open for further replies.
Back
Top