bencebence Posted July 23, 2011 Share Posted July 23, 2011 Hey everybody!I'd really appreciate some help.I made a script that'd play a sound (metal collision) if I drop an item (bar). But now if I have that item in my bag, it automaticly drops it... And I can't pick it up, because it drops again...Here is the script:scn RVMetalSound1 Begin GameMode if player.drop AyliiteBar 1 PlaySound CMetalLarge endif endWhat's wrong?Thanks in advance,bencebence Link to comment Share on other sites More sharing options...
WarRatsG Posted July 23, 2011 Share Posted July 23, 2011 You would be better off using an "OnDrop" block instead of a GameMode block. The function you used was not designed for use in an "if block". Here is an exampleBegin OnDrop Player Playsound CMetalLarge End Let me know if that works. Link to comment Share on other sites More sharing options...
PrettyMurky Posted July 23, 2011 Share Posted July 23, 2011 I don't think that's how the drop function works. It's not a value that is set to true whenever the something is dropped, it is thing function that does the actual dropping, and your gamemode script is calling it in the 'if' statement, to see if it yields a 'true' result. What you need is OnActorDrop event handler. I've noticed you've asked a few scripting questions recently. You seem to understand coding logic fairly well, if I were you I'd give the OBSE documentation a good read through. OBSE is so damned powerful compared to the vanilla CS, and has so many simple ways of doing things that are impossible without it. Link to comment Share on other sites More sharing options...
PrettyMurky Posted July 23, 2011 Share Posted July 23, 2011 Actually, yeah, WarRats solution is probably better in this case. As you're not working with a pre-existing object. But none-the-less, the OBSE docs contain the key to every locked door in Oblivion! Link to comment Share on other sites More sharing options...
WarRatsG Posted July 24, 2011 Share Posted July 24, 2011 Yeah I just learned how to use arrays and event handlers last week, and so many things have become so much easier :L :L Link to comment Share on other sites More sharing options...
bencebence Posted July 24, 2011 Author Share Posted July 24, 2011 Thanks everyone! Kudos for you :P Link to comment Share on other sites More sharing options...
Recommended Posts