Hello! I’m making a Bendy And The Ink Machine Fangame. And I Wanna Make The Axe. How Do I Do That? I Want A Specific Board To Break If The Player Is Holding The Axe And Clicks On The Board And It Doesn’t Work If You Just Touch The Board With The Axe Without Clicking. How Do I Make This?
EDIT :
Heres the script. I have no idea where to start.
–// Variables //–
– Other
local Tool = script.Parent
local Animation = Tool.Swing
local Cooldown = 0.8
local debounce = false–Damge
local Handle = script.Parent.Handle
local PlayersHit = {}– Plank
local Plank = workspace.BreakablePlank
local LeftPlank = Plank.LeftPlank
local RightPlank = Plank.RightPlank–// Script //–
Tool.Activated:Connect(function()
if debounce then return end
debounce = true– Play Animation
local Character = Tool.Parent
local Humanoid = Character.Humanoidlocal AnimationTrack = Humanoid:LoadAnimation(Animation)
AnimationTrack:Play()
Tool.SwingSound:Play()– Do Damage
Handle.Touched:Connect(function(Hit)
if Hit.Parent:FindFirstChild(“Humanoid”) and Hit.Parent ~= Tool.Parent thenif debounce == true and PlayersHit[Hit.Parent] == nil then Hit.Parent:FindFirstChild("Humanoid"):TakeDamage(50) PlayersHit[Hit.Parent] = true wait(Cooldown) PlayersHit[Hit.Parent] = nil end end
end)
– Cut Down Planks
wait(Cooldown)
debounce = false
end)