How would i script a axe like lumber tycoon

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    script a axe that chops down a tree

  2. What is the issue? Include screenshots / videos if possible!
    idk how to do it

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    i looked it up on youtube and found nothing

There isn’t really enough information here for us to help you. Have you tried any code, at all? Showing us what you’ve tried allows us to easily check your code for errors, tell you what you might need to add or remove, etc.

Moreover, we need information like what kind of trees are you using (It’d be nigh-impossible to write a script that works for every type of tree.), what kind of axe are you using, etc.

Regardess, you aren’t supposed to use DevForum to ask full scripts. There are plenty of beginner’s guides on here, and on the Developer Hub, and I definiutly reccomend checking those out first, and attempting to write a script. Good luck!

im not asking for a full script im asking how i would cut the part with a axe

You are supposed to ask for help, not for someone to do it for you, you’d have to hire someone for that.

2 basic things I’ll tell you that you need to know about…
You first, need to know how the ‘Tool’ works on roblox, secondly the Players Mouse to check whether the mouse is on a tree.

Also, you’d make the size of the tree, smaller than it was.

1 Like

do i use union and separate because idk how i would cut it based on where you clicked it

Well, if you wanted a system exactly like Lumber Tycoon, you’d need a lot of different elements.

For a simple version, you’d need to detect a click with the tool, and when a click is detected, see if there are any trees nearby, if there are, delete the current tree, and replace it with a tree with slightly lower durability. This is not efficient in any way, but it’s the simplest way to do this, AFAIK.

  1. Click Detector in tool.
  2. Check if tree’s are nearby.
  3. Delete the nearest tree.
  4. Copy a tree with lower durability from Server or Replicated Storage.
  5. Take the copy, and put it in the same location as the old one.

A more advanced method and efficient, method would be via Remotes, and a simpler, but still not as efficient, would be storing the tree’s durability level via a NumberValue as a child of the tree model.

1 Like

i have it to where id you click the tree and your near it after 10 clicks it wil unanchor but i need to chop the part like lumber tycoon

Well, instead of unanchoring, you could just have the upper portion of the tree anchored, and after ten clicks, unanchor the upper portion, causing it to fall, and leaving the stump.

1 Like

like this

What I described was a rudimentary system, to have the same capability as Lumber Tycoon, you’d need to use an entirely different system of tracking where the mouse hit.

ok how would i cut the part like the lumber tycoon axe

i almost have it working so hopefully i can get it to work:)

Good luck! If you need more help, DevForum is always open.