Trying to Instance a tool, can't seem to figure it out. Can anyone help?
I'm new to the whole development aspect of Roblox and I've been working on improving my skills as a rookie developer. I've been working on a game involving cutting down trees to get wood and I wanted to make it so that the wood you just collected by chopping down a tree is in your inventory and you're able to hold it. This means that it will have to be a tool and is needed to be a child of the StarterPack.
I've tried various different things and I've come to a conclusion that Instancing a tool would be the best way to go (just because it's going to be a block of wood and should be easy to model via code) I saw on the web that a tool needs to have a child named "Handle" to be able to be held so, here's my code:
01 | local pines = game.Workspace.Game.LumberForest.LumberPines |
04 | local pine = pines:FindFirstChild(pines.PineTree) |
06 | script.Parent.MouseClick:Connect( function () |
08 | game.Workspace.Game.LumberForest.LumberPines.PineTree:Destroy() |
10 | local wood = Instance.new( "Tool" ) |
11 | wood.Parent = game.StarterPack |
14 | local handle = Instance.new( "Part" ) |
16 | handle.Name = "Handle" |
17 | handle.Material = "Wood" |
I've been debugging this for quite a while and I still can't seem to figure it out. If there's an easy solution to this, please let me know (and go easy on me, I'm new)