Hello, Im creating a tree that you can cut with an axe tool or without the axe.
The tree works using a ProximityPrompt, the tree works fine but the axe doesnt.
here are the scripts
Axe Equipped Script (doesnt work)
local Axe = "WoodenAxe"
local Player = game.Players.LocalPlayer.Backpack
script.Parent.MouseButton1Click:Connect(function()
if Player:FindFirstChild(Axe) then
Player.Axe.Equipped:Connect(function()
script.Parent.Wood.GetWood.HoldDuration = 2
end)
Player.Axe.Unequipped:Connect(function()
script.Parent.Wood.GetWood.HoldDuration = 2
end)
end
end)
Main (Works)
local tool = game.ReplicatedStorage.Wood
local GetWood = script.Parent.Wood.GetWood
local Plant = script.Parent.Dirt.PlantTree
GetWood.Triggered:Connect(function(Plr)
local backpack = Plr:WaitForChild("Backpack")
tool:Clone().Parent = backpack
script.Parent.Wood.Transparency = 1
script.Parent.Wood.CanCollide = false
script.Parent.Leaves.Transparency = 1
script.Parent.Leaves.CanCollide = false
script.Parent.Dirt.Transparency = 0
GetWood.Enabled = false
Plant.Enabled = true
end)
Plant.Triggered:Connect(function()
Plant.Enabled = false
wait(10)
script.Parent.Wood.Transparency = 0
script.Parent.Wood.CanCollide = true
script.Parent.Leaves.Transparency = 0
script.Parent.Leaves.CanCollide = true
script.Parent.Dirt.Transparency = 1
GetWood.Enabled = true
end)
I want to make it so when the axe tool is equipped then the proximityPromte hold duration is less but when the tool is unequipped it goes back to normal hold duration