Dealing with other's variables

J

jakubkman

Guest
What i'm trying to do is find out if the blocks around a block have the variable owner set to 1.
this is my current code.im not sure what i did wrong.maybe its completely wrong.i dont know.please help
{
Code:
north=instance_id=(instance_place(x+3,y+3,other))
east=instance_id=(instance_place(x+27,y+5,other))
south=instance_id=(instance_place(x+28,y+28,other))
west=instance_id=(instance_place(x+5,y+27,other))

with (north)
{
if owner = 1
{
instance_destroy()
}
}

with (east)
{
if owner = 1
{
instance_destroy()
}
}
with (south)
{
if owner = 1
{
instance_destroy()
}
}

with (west)
{
if owner = 1
{
instance_destroy()
}
}
 

FrostyCat

Redemption Seeker
If you had the sense to read the Manual entries on instance_id, instance_place() and other before using them, you'd know what's wrong.
Code:
north = instance_place(x+3, y+3, object_index);
By the way, read this too and reconsider whether instance_place() is really what you need.
 
J

jakubkman

Guest
Okay,I read most of the manuals and used the code you provided,however i'm till finding that the blocks around (owner =1)blocks are not getting deleted
Am i using the with statement wrong? it seems like the (owner = 1) blocks are being destroyed.


http://imgur.com/a/Y2Bcv
 
Top