Oh, right, that WOULD happen.
This is actually because of the reduntacy I mentioned before.
You might have to use
for statements after all.
And the other part is basically because to subtract you need 2 -'s. like this " -- " . Dunno, why you don't need 2 +'s but sure there's a reason.
So here's how it would go:
Code:
plotscript,game,begin
playing := true
while (playing) do(
variable (spoon)
for (spoon,0,NPC copy count (1)--1,1) do,begin
mob1:=npc reference (1,spoon)
if (pposx == npx(mob1) ,and, pposy==npy(mob1) ) then (
destroy npc (mob1)
destroy npc (2)
)
end
if (key is pressed(44)) then (
if (npc copy count (2) == 0) then (
posx := hero X (0)
posy := hero Y (0)
direction := hero direction (0)
if (direction == up) then (
create npc (2,posx,(posy)+1)
wait for npc (2)
)
if (direction == down) then (
create npc (2,posx,(posy)--1)
wait for npc (2)
)
if (direction == left) then (
create npc (2,(posx)+1,(posy))
wait for npc (2)
)
if (direction == right) then (
create npc (2,(posx)--1,(posy))
wait for npc (2)
)
)
)
pposx := npc X (2)
pposy := npc Y (2)
wait (1)
)
end
I also fixed up the attack part which hadn't been mentioned before your last post.
I'm kind of interested to see what you're doing with this script.
The wait for npc command and lack of a way to delete the npc after it's made if it misses the target intrigues me.\
EDIT: messed around with the script a little. Still haven't tested it though.