
KeylessUniversal

local tool = script.Parent
local handle = tool:WaitForChild("Handle")
-- Damage settings
local damageAmount = 25
local canDamage = false
-- Function to handle swinging and dealing damage
handle.Touched:Connect(function(hit)
if not canDamage then return end
-- Check if it hit a player
local model = hit:FindFirstAncestorOfClass("Model")
if model then
local humanoid = model:FindFirstChild("Humanoid")
if humanoid and humanoid ~= tool.Parent:FindFirstChild("Humanoid") then
humanoid:TakeDamage(damageAmount)
canDamage = false -- Prevent instant multiple hits
end
end
-- Check if it hit a destructible environment block
if hit:HasTag("Destructible") then
hit:Destroy()
end
end)
-- Activate the Sledgehammer swing
tool.Activated:Connect(function()
canDamage = true
-- Add swing animation or sound here
task.wait(0.5) -- Swing duration
canDamage = false
end)No comments yet for this script.



