--local TwoHandAnim = hammer:WaitForChild("TwoHandAnim")


hammer.Equipped:Connect(function()
	local character = hammer.Parent
	if Players:GetPlayerFromCharacter(character) and character:FindFirstChild("Humanoid") then
		--character.Humanoid.Animator:LoadAnimation(TwoHandAnim):Play()
		end
end)


hammer.Activated:Connect(function()
	local character = hammer.Parent
	if db == false and Players:GetPlayerFromCharacter(character) and character:FindFirstChild("Humanoid") then

		--character.Humanoid.Animator:LoadAnimation(Slash):Play() -- Plays the animation

		local touchFunction
		touchFunction = hammer.Handle.Touched:Connect(function(hit) -- Fires when the hammer is touched
			local hitCharacter = hit:FindFirstAncestorOfClass("Model") -- The character we hit
			local hitPlayer = Players:GetPlayerFromCharacter(hitCharacter) -- Player we it
			local banSound = script.Parent.Handle.ban
			if hit and hitCharacter and hitPlayer then -- if we hit a player
				--banSave:SetAsync(hitPlayer.UserId,true) -- Saves the ban (Don't do this if you only want to kick them)
				hitPlayer:Kick("Congratulations! You just got kicked by the ban hammer! Be lucky you didn't banned instead!") -- Kicks with the provided message
				banSound:Play()
				touchFunction:Disconnect() -- Ends the function
			end
		end)

		db = true -- Enables cooldown
		task.wait(1) -- You might need to adjust this
		touchFunction:Disconnect()
		task.wait(1-0.3) -- The cooldown
		db = false -- Disables cooldown

	end
end)
