Need help on this sort of system
Hello, I am a fellow developer and was wondering if it is possible to script/make a system where if you have a pickaxe you can destroy coins and chests and certain pickaxes do certain amount of damage.
you create a tool, put an intvalue inside the tool with the amount of damage it will do, and for detecting chest you can either use raycasting when the tool is activated or do something like a click detector that finds the tool you are holding and then the damage it would do or you could even use Touched event of the tool although that may not be the ideal way.
Store each pickaxe in a dictionary like
local pickaxes = {
wood = {damage = 1, cost = 0, tool = game.ReplicatedStorage.Pickaxes.Wood, …},
}
So you know how to do this I was wondering if you could hop in studio and help me do it I have a tool.
You can check every RunService.RenderStepped if Mouse.Target.Parent is the coin, then move a selectionbox’s adornee to that part. Then do Mouse.Button1Down and stop if Mouse.Target changed or Mouse.Button1Up