There is something wrong with my code, it doesn’t show any errors though. One im trying to do is that when the pickaxe hits the rock there is a billboard gui above it that adds the number by 20, My 2 codes are listed below, I am also aware that there is no debounce on the pickaxe so that it may add the number by 2 or 3 more times but tthe number just stays the same.
Pickaxe code:
local Ore = part.Parent:FindFirstChild("RockOre")
if Ore then
local OreValue = Ore.Parent.BillboardGui.Value.Value
OreValue = OreValue + 20
print("Mined!")
end
end
script.Parent.Touched:Connect(Mine)
Ore code
while true do
local Value = script.Parent.Value.Value -- get the current value
script.Parent.TextLabel.Text = ("%" .. Value)
wait(debounceTime) -- pause the loop for the debounce time
end
the print functions do work in the pickaxe code btw.