Jump to content

Destroying a Static with Melee via Script


KDStudios

Recommended Posts

@TheTalkieToaster: You're right. Thank you. :)

 

New script. Counts up. Also MIGHT have fixed the reset time.

 

Change the 2 in "if ( iHealth == 2 )" to one number lower then what you actually want. 2 = 3 hits, 3 = 4 hits...

 

scn 0MCWoodHarvestScript

int iHealth
int iStage

float fTimer

Begin OnHitWith 0WeapAxeIron

if ( iHealth == 2 )
	Player.AddItem mcblockwood 1
	Disable
	MarkForDelete
else
	Set fTimer to 2
	Set iStage to 1
	Set iHealth to iHealth + 1
endif

End

Begin GameMode

if ( fTimer > 0 )
	Set fTimer to fTimer - GetSecondsPassed
elseif ( iStage == 1 )
	Set iStage to 0
	Set fTimer to 0
	Set iHealth to 0
endif

End

Link to comment
Share on other sites

  • Replies 49
  • Created
  • Last Reply

Top Posters In This Topic

Works like a charm!

The timer resets after it's left for a few seconds.

Decided to leave it at 3 hits per block.

 

Now I can start to add this to all the blocks, adjusting accordingly for different tools and blocks :)

 

You're the best! :)

Link to comment
Share on other sites

Well I was having trouble with my crafting bench

The schematic system was giving me grief.

So I've decided to scrap it all together :D (Well for the most part)

 

Can someone tell me why button 2 doesn't work. It just will not do anything even though 1, 3, 4 and 5 work fine.

Here's the script:

 

  Reveal hidden contents

 

Link to comment
Share on other sites

Maybe this fixes it. You had declared Button twice, so I removed the second one. Also, you had too many "endif" inside each Button if statements.

 

 

  Reveal hidden contents

 

Edited by Alexx378
Link to comment
Share on other sites

I just tried it out and...

 

Well aint you turning out to be the best thing to come across my sorry scripting :P

It works like a charm!

 

It must have been my endless spam of "endif's" haha. http://www.thenexusforums.com/public/style_emoticons/dark/wallbash.gif

I think I'm getting there slowly with scripting though :)

 

Thankyou so damn much o_O! http://www.thenexusforums.com/public/style_emoticons/dark/woot.gif

Link to comment
Share on other sites

  • 2 weeks later...

Hey I kinda have a new problem.

 

I hit a brick wall when adding more buttons to the Crafting Bench menu.

Turns out the maximum amount of buttons we can have is 9.

So I figured I'd make button number 9 a "More" Button.

Problem is I don't know how to turn it into a "More".

 

So what I've done so far is turn Button 9 into a button called "More"

Then in the crafting script I added this simple line

 

 

elseif button == 9

ShowMessage 0SchCraftingbenchMsg2

 

Now the button works perfectly and shows the new menu to the crafting bench.

Then I figured out that obviously it won't run the script that the menu is based on and assumes that menu is for the script I am using for the first message.

What do I have to write to make it independent?

 

Would I need to make a new activator and instead of having it as ShowMessage 0SchCraftingbenchMsg2 and have it something like Activate CraftingbenchMC2 (Completely wrong I know but that's the 2nd idea I have to do it)

 

So yeah. Suggestions/advice if possible anyone?

 

Thanks again.

Link to comment
Share on other sites

Actually I took a look at that just then and that might work!

Kudos to you for the reply and I'll be sure to get back with the outcome, but by the looks of it. It's simple enough to implement and you may have saved my backside :D

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...