Minsk
Just Arrived
Posts: 23
|
Post by Minsk on Dec 7, 2013 19:09:53 GMT
Hi.
I am currently running through different ideas for a mod I'm trying to create. As part of this mod I'm adding bathing as an option but was wondering if there was a way of creating multiple use items such as soap. It just seemed strange that a large bar of soap only lasted for one use. This is the script I'm using at the moment if it helps.
Thank you Minsk (SnowOwl)
Begin _OwlBath
short button if (OnActivate== 1) MessageBox "Do you wish to wash?" "No" "Yes" endif
set button to GetButtonPressed
if (button==0) Activate endif
if (button==1) if ( Player->GetItemCount, "_Soap" == 0 ) MessageBox "You need some soap to have a wash" endif
if ( Player->GetItemCount, "_Soap" >= 1 ) Player->removeitem "_Soap" 1 FadeTo 100 0.5 FadeTo 0 2.0 MessageBox, "You feel better after that long relaxing bath." endif endif
end _OwlBath
|
|
|
Post by Jac on Dec 9, 2013 4:06:39 GMT
Try this. Also, don't use a preceding _ in your script titles or IDs.
Begin OwlBath
short button
if ( OnActivate ) MessageBox "Do you wish to wash?" "Yes" "No" endif
set button to GetButtonPressed
if ( button == -1 ) return elseif ( button == 0 ) if ( Player->GetItemCount, "_Soap" == 0 ) MessageBox "You need some soap to wash." return else FadeTo 100 0.5 FadeTo 0 2.0 MessageBox, "You feel better after that long relaxing bath." endif else return endif
end
|
|
Minsk
Just Arrived
Posts: 23
|
Post by Minsk on Dec 9, 2013 18:54:29 GMT
Thank you (twice). That's just what I wanted and for the underscore advice, Thanks )
|
|
|
Post by Jac on Dec 11, 2013 18:53:05 GMT
You're welcome. You can remove extra soap bars if you want by adding in the if ( Player->GetItemCount, "_Soap" >= 1 ) & Player->removeitem "_Soap" 1 lines to the else part of the if statement after the MessageBox. It should look something like this:
else if ( Player->GetItemCount, "_Soap" >= 1 ) Player->removeitem "_Soap" 1 endif FadeTo 100 0.5 FadeTo 0 2.0 MessageBox, "You feel better after that long relaxing bath." endif
|
|
Minsk
Just Arrived
Posts: 23
|
Post by Minsk on Dec 14, 2013 15:28:58 GMT
Cool. Thank you again.
|
|