Trying to make a pickaxe to break a part whis hp and drop something!

Hey i am trying to make a game whis a breaking like in the game booga booga where you can
break for exemple a tree whis a pickaxe and when all the hp of the tree are remove the tree get removed and drop something whis a % of chance to drop .

I dont know how to do it and if you can help me to create it or teach me how to do it I would thank you .

thx for readind this post .


What part are you confused about or the whole thing?

1 Like

i dont know how to do the whole thing .

i have the part ( pixaxe , tree , drop part ) but no script for it can you help me ?

So all you got to do is just make the pixaxe into a tool and then make it so if the tree is touched with the pixaxe then it will reduce the HP. You can store the HP in attributes inside the tree which I feel would be the best way to do this. When the tree is hit with the pixaxe reduce it untill it hits 0 or what ever then make it so that the tree is deleted and a part is dropped where the tree was.

You may want to also check that when the pixaxe hits the tree that the tool is currently being used just so that you don’t have people just being able to put the axe on the tree without having to click.

Not sure what you mean by a % but that may be done by the random thing.

Thats the basic idea of how you would do it you just now to script it.

1 Like

thx i gonna try to do this i give feedback after or if i need help !

1 Like

Hey i have this so far in a local script in my pickaxe

local pioche = script.Parent

local Player = game.Players.LocalPlayer

local Mouse = Player:GetMouse()

if ( here i want want to put what i said you under the code )


I also create a intvalue named breakable and a numbervalue named HP inside the model of my tree .

can you help me to get – if what is hit have breakable inside it – please .

can somoene help me whis that ?

dont need help for that i did it my self thx !