-
key and chest
I'm using CS4 and I am having trouble setting an event,
I want the chest to open up only if the key is in the inventory after being picked up, but the chest opens any time even with out the key and I need to know how to fix this.
I will replace the graphics later.
http://www.kacieartist.freeiz.com/invenkey.zip
-
.
Hi,
If you select the keybronze movieclip and look at the code placed on it, you missed an = sign
it should be
PHP Code:
if (this.hitTest(_root.hero.hit_area) && touched == false)
and not
PHP Code:
if (this.hitTest(_root.hero.hit_area) and touched = false)
-
Thanks for the help but the chest still opens without the key.
-
.
Hi,
As before you have missed an = sign on another clip code.
on the chest clip, use
PHP Code:
if (_root.hero.hitTest(this) && (Key.isDown(Key.SPACE)) && (_global.slot_spot2 == "keybronze"))
instead of
PHP Code:
if (_root.hero.hitTest(this) && (Key.isDown(Key.SPACE)) && (_global.slot_spot2 = "keybronze"))
-
I just worked it out I used the wrong _global thanks for your help though toward this thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|