#When an enemy gets closer, it hides, but it doesn't!

1 messages · Page 1 of 1 (latest)

ionic spade
#

I made a script where a tower will hide when there's an enemy near it, like scaredy-shroom from Plants VS. Zombies. But it doesn't, I suspect it's the Local Variable for the enemy. I have tried to fix it in many ways but still cannot. Can someone help me?

ionic spade
#

why nobody help mesadjulian

sonic yacht
#

I think it's better to use if condition

ionic spade
#

Then the animation will loop

#

Ig

#

Doesn't work.

ionic spade
#

The script works JUST fine

radiant heart
#

Make it blue

#

Wait nvm

#

Actually this looks like it would work ngl

ionic spade
#

But the local Variable

#

The local Variable @radiant heart

#

The script works

#

But the local Variable for the enemy

#

(I use local Variable because it's much simpler

radiant heart
#

Hmm

ionic spade
#

I think I have to stop using local Variable

#

To "simplify things"

marble musk
#

It's more like

#

Complex

flint glen
ionic spade
#

M'kay

#

And I changed the functions of the tower

#

Gotta lock this postt

flint glen
#

the problem i see here is the distance

ionic spade
#

Why

#

Is there something wrong with the distance

#

Just asking

#

In case I will make another one

#

With this kind of script

flint glen
#

it's not quite specific

ionic spade
#

the Keep Wait

flint glen
#

?

ionic spade
#

Is it the keep wait block

#

Or the distance itself

flint glen
#

yea

ionic spade
#

Keep wait or the distance itself

flint glen
#

wouldn't both count?

#

if the distance can't be detected then keep wait can't work

ionic spade
#

But yeah

#

How do you fix this

#

That tower name used to be like a mix of Afraid and Moonick

flint glen
#

just change distance to smth more specific like x/y coordinate compare to the actor

ionic spade
#

Since its functionality is changed, it was changed to Medonick

ionic spade
#

Never thought of that

#

But how do I compare?

#

@fierce plover is me

#

Just a fun fact

flint glen
#

If {ENEMY} X coordinate < or = {Self} X coordinate then

ionic spade
#

I want it to be like a specific distance

#

Like if it's 3 blocks away it'll hide

flint glen
ionic spade
#

Oh yeah

#

W-wait

#

I'll just use the + thing

#

Like you know

#

The coordinates + thing

flint glen
#

wont work

#

although it meant for "specific distance"

ionic spade
#

I meant how many tiles away

#

Like uhh

#

Uhh

flint glen
#

the coordinate wont change

flint glen
ionic spade
#

This

#

Won't that work

flint glen
#

nope

#

it can only be used in set attribute

ionic spade
#

Oh