Jump to content

Strange thing


bencebence

Recommended Posts

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
end

What's wrong?

Thanks in advance,

bencebence

Link to comment
Share on other sites

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 example

Begin OnDrop Player
    Playsound CMetalLarge
End

 

Let me know if that works.

Link to comment
Share on other sites

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...